exbrief Posted February 7, 2009 Report Share Posted February 7, 2009 I have some php scripts in the header.php file on my WordpresMU 2.7 powered site. These worked fine on Wordpress MU 2.6, but now it is not working on the new version. Basically the script counts the number of entries in one of my databases which translates into the total number of entries created by users. The issue is that the script causes the "Full Name" field on the signup page (wp-signup.php) to disappear and the signup fails. If I remove the script from the header...works perfectly...but I need this information, therefore I need the script, or a modified version. PLEASE HELP ME SOLVE THIS, been trying everything I know and can't figure this out. Here is the full script, the offending script is in the center, it has lines above and below to make it easier to see.. > <?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> » Blog Archive <?php } ?> <?php wp_title(); ?> <?php wp_head(); ?> <?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 <?php bloginfo('description'); ?> Quote Link to comment Share on other sites More sharing options...
jlhaslip Posted February 7, 2009 Report Share Posted February 7, 2009 (edited) Set error reporting to E_ALL to see what the errors are??? Echo the query as a debug tool??? Script looks fine, right off the php.net manual. http://ca2.php.net/mysql-num-rows *edit* Assumes the connection info is correct... ? Edited February 7, 2009 by jlhaslip Quote Link to comment Share on other sites More sharing options...
exbrief Posted February 7, 2009 Author Report Share Posted February 7, 2009 (edited) Set error reporting to E_ALL to see what the errors are???Echo the query as a debug tool??? Script looks fine, right off the php.net manual. http://ca2.php.net/mysql-num-rows *edit* Assumes the connection info is correct... ? connection info is right, i used the ***** to block the sensitive info. The code does work fine. Here is how I know its the code causing the error..... Remove code, signup works fine, put the code back in..... Error returns. there is an html form on the signup page, with fields, there is a field called "Full Name"...its there when the script is not in the header, but put the script back inthe header...and tada! the field is missing and you can not create an account. Its something that changed in WPMU 2.7, because the website had no issues before the upgrade. Nobody there seems to know anything about this. Maybe another way to get theis information with a different script? Im a php novice and need a lot of help. thanks. my website is www.ex-brief.com Edited February 7, 2009 by exbrief Quote Link to comment Share on other sites More sharing options...
jlhaslip Posted February 7, 2009 Report Share Posted February 7, 2009 (edited) Add this line to the top of the script inside php tags error_reporting(E_ALL); ini_set('html_errors', 1); ini_set('log_errors', 0); ini_set('display_errors', 1); and run it again to see what errors pop up. Edited February 7, 2009 by jlhaslip Quote Link to comment Share on other sites More sharing options...
exbrief Posted February 7, 2009 Author Report Share Posted February 7, 2009 (edited) the error is not with the PHP.... I am running wordpress, the error is on the wordpress side. there is no php error logged, I just did what you said......because the script is fine and php is not the issue here. The issue is that the new WPMU does not like the script for some reason. The error when you sign up is because the signup page is looking for the "Full Name" field but can not find it because the php script in the header.php file is making it disappear.....WTF. This is really a pain in the a$$. Any other ideas? thanks. Here is the error when you try to sign up...see how its looking for the info but not getting it because the "Full Name" field is missing..... Anyone??? Warning: Invalid argument supplied for foreach() in /home/exbriefc/public_html/wp-content/mu-plugins/bp-xprofile/bp-xprofile-signup.php on line 104 ALSO I RAN WHAT YOU SAID AND HERE IS THE RESULT: 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 Edited February 7, 2009 by exbrief Quote Link to comment Share on other sites More sharing options...
jlhaslip Posted February 8, 2009 Report Share Posted February 8, 2009 If it was me, I would be after the Plug-in Author to check this out and they are the best source to have a fix written for the issue. Quote Link to comment Share on other sites More sharing options...
exbrief Posted February 8, 2009 Author Report Share Posted February 8, 2009 (edited) well, its buddypress that sits on top of Wordpress and takes the info from the wordpress signup page for its own purposes, hence the bp_ prefix. I have been in contact with them....they are clueless. Strange thing is that with buddypress out of the mix the same error is happening with Wordpress...exact same missing field, etc. is there some way to run the php script in a seperate file, and output the result somewhere else then use a standard wordpress or buddypress function/filter to call the information from that file so I can not use this code in the header? some type of work around? Edited February 8, 2009 by exbrief Quote Link to comment Share on other sites More sharing options...
exbrief Posted February 8, 2009 Author Report Share Posted February 8, 2009 (edited) tttttttttttttttttttt Edited February 8, 2009 by exbrief Quote Link to comment Share on other sites More sharing options...
exbrief Posted February 10, 2009 Author Report Share Posted February 10, 2009 anyone? Quote Link to comment Share on other sites More sharing options...
exbrief Posted February 12, 2009 Author Report Share Posted February 12, 2009 this is still a major issue, i have exhausted all my knowlegde and ideas as well as that of the Buddypress people. Anyone good with all this that can offer some insight> Quote Link to comment Share on other sites More sharing options...
andre88uk Posted February 22, 2009 Report Share Posted February 22, 2009 Ok so from what i can understand fromt he brief reading it simply misses the name field off when yu put the heder code in but when u remove the header code it comes back yes ? if this is the cae i would be lead to think maybe a missing " or ' to close a echo/query/html output ie . would cuae all sorts of errors like that hth Quote Link to comment Share on other sites More sharing options...
exbrief Posted February 23, 2009 Author Report Share Posted February 23, 2009 Ok so from what i can understand fromt he brief reading it simply misses the name field off when yu put the heder code in but when u remove the header code it comes back yes ? if this is the cae i would be lead to think maybe a missing " or ' to close a echo/query/html output ie . would cuae all sorts of errors like that hth Quote Link to comment Share on other sites More sharing options...
exbrief Posted February 23, 2009 Author Report Share Posted February 23, 2009 Ok so from what i can understand fromt he brief reading it simply misses the name field off when yu put the heder code in but when u remove the header code it comes back yes ? if this is the cae i would be lead to think maybe a missing " or ' to close a echo/query/html output ie . would cuae all sorts of errors like that hth could be. I dont think there is any syntax error anywhere, though. I have moved this item so this is nto an issue anymore, I just gave up....became too time consuming. thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.