jaikob Posted May 1, 2010 Share Posted May 1, 2010 Maybe I've been away from PHP too long, but my senses tell me this SHOULD work. $ip = $_SERVER['REMOTE_ADDR']; if(($ip != "XX.XXX.XX.XX") || ($ip != "XX.XXX.XX.XX") || ($ip != "XX.XXX.XX.XX")) { mail("....................................."); } The dots represent params in mail function. This somehow returns true everytime. The XX's represent frequent IP's. What is wrong? Quote Link to comment https://forums.phpfreaks.com/topic/200344-basic-if-statement-not-working/ Share on other sites More sharing options...
trq Posted May 1, 2010 Share Posted May 1, 2010 Your logic is a bit messed up. $ip = $_SERVER['REMOTE_ADDR']; if(($ip != "XX.XXX.XX.XX") && ($ip != "XX.XXX.XX.XX") && ($ip != "XX.XXX.XX.XX")) { mail("....................................."); } Quote Link to comment https://forums.phpfreaks.com/topic/200344-basic-if-statement-not-working/#findComment-1051384 Share on other sites More sharing options...
jaikob Posted May 1, 2010 Author Share Posted May 1, 2010 haha thanks for the refresher. Quote Link to comment https://forums.phpfreaks.com/topic/200344-basic-if-statement-not-working/#findComment-1051388 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.