Jump to content
  • Advertisement
Sign in to follow this  
Fuzzyhed

PHP error.

This topic is 3194 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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!