FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Php Syntax Errors, Need Help





smokey4life
Ok im trying to put a php shoutbox in my html pages i already have the .httaccess file parsing the php within the html file, but i keep getting this syntax error
Code:
Parse error: syntax error, unexpected T_IF in /home/smokey4l/domains/runesource.frih.net/public_html/chatbox/chatbox.php on line 133
and heres the code from which i get the error.
Code:
   if ( mysql_num_rows($res) ) {
      return false;
   }
Anyone see anything wrong?
Kaneda
Most likely there's an error in the lines before the ones you posted. When a compiler complains about "unexpected <something>" it's usually because there's an error just before it - check if you're missing a semicolon (";") in the line before it - or paste a few of the lines if you still can't find the error Wink
smokey4life
Yeah there was a missing semicolon in the line before it Wink but now im getting this error
Code:
if ( $flood_time > 0 ){
   // call the function
   if ( !check_flood($val_ip,$flood_time)
      // Reeport the error
      $error="yes"; $log[] = "Slow Down";
   }
}
Heres the error
Code:
Parse error: syntax error, unexpected T_VARIABLE in /home/smokey4l/domains/runesource.frih.net/public_html/chatbox/chatbox.php on line 191
Any ideas?
Kaneda
Well, if you also pasted the error, it might help Wink Can't see any problems with that line of code.
smokey4life
Lmao im sorry i edited my previous post.
Kaneda
Missing an end paranthesis (and judging from indentation, an opening bracket too) in the line:

Code:
if ( !check_flood($val_ip,$flood_time)


should be:

Code:
if ( !check_flood($val_ip,$flood_time)) {
smokey4life
Yup, that was the problem right there. Thanks for your time and help i really appreciate it. Very Happy
Related topics
simple php problem, please help...
[Official] Best PHP Editor
php script in php nuke - need help!
php-nuke - Forum Help (phpbb)
PHP Help
Uploading a .php file! NEED HELP thanks
Can I have some help with scripts for postmysite.frih.net
Php code messed up. What's wrong?
php..free account help
Connected to another part of a php script.
Cant understand errors! help please
PHP Read File Help needed.
Delphi IDE by CodeGear for PHP coding !!!
Best :: HTML Editor ::
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.