Skip to:
Content
Pages
Categories
Search
Top
Bottom

PHP in my header.php causing signup errors

  • ok, here is the deal. I have a PHP script in my header.php file. the actual script works fine, but it causes the wp-signup.php to be missing the “Full Name” field, so nobody can signup…you get an error if you try.

    I have narrowed it down to the following php code, but I can not seem to figure out how I can include this php script and make this all work…anyone have any clue? thanks/

    THE CODE CAUSING THE ISSUE:

    the part of the code that is BOLD is the problem. the rest of the code is to show you where I have it in the file.

    <body>

    <div id=”page”>

    <div id=”header” onclick=”location.href=’http://ex-brief.com/';” style=”cursor: pointer;”>

    <div id=”headerimg”>

    <h1>

    <?php

    $stats = get_sitestats();

    echo “”.$stats[ 'users' ].” Members”;

    ?>

    <?php

    $username=”*********”;

    $password=”*********”;

    $database=”*********”;

    mysql_connect(localhost,$username,$password);

    @mysql_select_db($database) or die( “Unable to select database”);

    $result = mysql_query(“SELECT * FROM contacts”);

    $num_rows = mysql_num_rows($result);

    echo $num_rows;

    mysql_close();

    ?>

    ExBriefs

    </h1>

    <div class=”description”><?php bloginfo(‘description’); ?></div>

    </div>

Viewing 12 replies - 1 through 12 (of 12 total)
  • check this out, ran error reporting via php……. here is the result

    Notice: Undefined offset: 0 in /home/exbriefc/public_html/wp-includes/wpmu-functions.php on line 899

    Notice: Trying to get property of non-object in /home/exbriefc/public_html/wp-content/mu-plugins/bp-xprofile/bp-xprofile-classes.php on line 203

    Notice: Undefined index: field_1 in /home/exbriefc/public_html/wp-content/mu-plugins/bp-xprofile/bp-xprofile-signup.php on line 106

    Notice: Trying to get property of non-object in /home/exbriefc/public_html/wp-content/mu-plugins/bp-xprofile/bp-xprofile-classes.php on line 203

    Notice: Trying to get property of non-object in /home/exbriefc/public_html/wp-content/mu-plugins/bp-xprofile/bp-xprofile-classes.php on line 982

    now I pull the php script that is causing the error out of header.php….. and guess what no errors and you can create an account no issues.

    this is a BP related error….nobody has a clue? I sure don’t. Sucks having unusable software.

    I pulled BP totally out and dropped all related tables in the Database….and low and behold my site works FINE without BP installed. So with all the investigating I have done I have come to the conclusion this is a BP specific problem. This is the place to get help. Can anyone at all help me out here…Andy? Anyone? I would greatly appreciate the assistance.

    thanks.

    Buddypress is not unusable software. I suggest being a bit more polite if you come looking for help, especially to the official Buddypress forums.

    It’s because you’re trying to shoehorn a PHP script into your theme. Either one of the PHP variables you use in the snippet in bold is used elsewhere by Buddypress – thus getting weird conflicts – or it’s to do with one of your mysql_ function calls, possibly mysql_select_db().

    was not trying to be rude, sorry if it came off that way. This script was used with the Beta 1 of BP without issue, so whatever changed in the Beta 2 that is related is what I need to find a workaround for. Just asking for some guidance/assistance. The script is textbook php so it works fine from that respect…. I have 2 databases in mySQL, 1 that is for the WordPressMU and Buddypress, and another that I created separately for another part of my site….the second database is the one the script is calling.

    Any thoughts?

    Were you using the same version of WordPress MU when you were testing with Beta 1?

    no

    THE SCRIPT, and the signup process worked fine with this combination:

    WPMU 2.6 / BP Beta 1

    I upgraded to the following and then it stopped working:

    WPMU 2.7 / BP Beta 2

    However if I take BP out of the picture totally and uninstall it, the WPMU signup process works perfectly as does the script.

    Also, I just downloaded and re installed the latest BP as of 3 am this morning (and dropped all related mySQL tables)…did not help.

    Avatar of Andy Peatling
    Andy Peatling
    Keymaster

    @apeatling

    Do a clean install, no custom plugins, use the default themes. Report back if you still get an error.

    did this, even used clean install of WPMU and new mySQL database……. same issue. something about the beta2 of BP does not like me inserting this php script into the header.

    Everything works fine until I put this script into the header. I can either have the script and WPMU or Buddypress and WPMU…but not the script and Buddypress. They really have issues with each other, worked fine on BP Beta 1, WPMU 2.6.

    This is the second time I have Reinstalled all this from scratch, and that’s not fixing it.

    Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    Andy I’ve already done this with realfam. See: http://buddypress.org/forums/topic.php?id=1018

    This is just a new thread for the same situation.

    yeah, i did the troubleshooting to find the problem like you wanted burtadsit….and I know the issue, but I did not write Buddypress so I don’t know why the error is happening. Now that I know the EXACT issue I just need some help fixing the actual problem.

    ttt

    Avatar of Andy Peatling
    Andy Peatling
    Keymaster

    @apeatling

    Use the trunk and everything will be fine. Closing this because this has been fixed.

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘PHP in my header.php causing signup errors’ is closed to new replies.