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? 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("....................................."); } 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. 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
Archived
This topic is now archived and is closed to further replies.