Username: Posted September 21, 2010 Share Posted September 21, 2010 Is this right? $admin = array('24.68.200.235','24.68.214.97'); $visitor_ip = $_SERVER['REMOTE_ADDR']; if($visitor_ip == $admin) { echo "k"; } else { die("dead"); Quote Link to comment Share on other sites More sharing options...
the182guy Posted September 21, 2010 Share Posted September 21, 2010 No it has a syntax error, you're missing a } at the end. If you meant, is it the right way to check the visitor IP against a list, then use in_array like this if(in_array($visitor_ip, $admin)) { // visitor is an admin Quote Link to comment Share on other sites More sharing options...
Username: Posted September 21, 2010 Author Share Posted September 21, 2010 No it has a syntax error, you're missing a } at the end. I know that lol, I just C + Ped it and missed a bracket, but I want it to check for either of those IPs but it only checks the first one, what do I do? EDIT: Thanks! Quote Link to comment Share on other sites More sharing options...
the182guy Posted September 21, 2010 Share Posted September 21, 2010 No it has a syntax error, you're missing a } at the end. I know that lol, I just C + Ped it and missed a bracket, but I want it to check for either of those IPs but it only checks the first one, what do I do? See my edit. 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.