• Advertisement
Sign in to follow this  

PHP error.

This topic is 2979 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok, I am just starting to use arrays and to learn how to give certain IP's certain things.This is what I have. <title>Zeron's test site</title> <? $ipaddress = $_SERVER['REMOTE_ADDR']; $adminip=array('98.67.5.16','174.57.245.45'); if ( $ipaddress == $adminip ) { echo 'Bobber, If you see this Xfire me saying FUZZLEZ!'; echo ''; } else { echo 'Hello'; } ?> Want to see the error message? Parse error: syntax error, unexpected ';', expecting ')' in /home/a3417341/public_html/default.php on line 5

Share this post


Link to post
Share on other sites
Advertisement
I don't see any syntax error in your code. Are you sure that's all your code, and the code for the correct file?

However, your $ipaddress == $adminip comparison isn't going to do what you want. Use the in_array function instead: in_array($ipaddress, $adminip)

Share this post


Link to post
Share on other sites
You can use [ source lang="php"] [/source] or [ code] tags (remove the space after "[" ) to show source code.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement