Sign in to follow this  
Fuzzyhed

PHP error.

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this