werty37 Posted November 12, 2006 Share Posted November 12, 2006 HIALLOW is a constant and it has either an IP address or a string 'All'. I include this script in all the pages so that i can debug the site from the specified IP and others stil wouldnt be able to see it.I have got a problem in this code. say i have an ip 127.0.0.21 stored in the constant ALLOW but my ip is different, i am stil able to access the page. it does not redirect to the specified page[code]if ( (ALLOW!=$_SERVER["HTTP_X_FORWARDED_FOR"]) || (ALLOW!="All") ) {header("Location: uc.php");}[/code]Any help would be appreciated Link to comment https://forums.phpfreaks.com/topic/26978-basics/ Share on other sites More sharing options...
sasa Posted November 12, 2006 Share Posted November 12, 2006 statement '$a != 1 or $a != 2' is allways true!!I think thet you want (ALLOW == $_SERVER["HTTP_X_FORWARDED_FOR"]) || (ALLOW == "All")or (ALLOW != $_SERVER["HTTP_X_FORWARDED_FOR"]) && (ALLOW != "All") Link to comment https://forums.phpfreaks.com/topic/26978-basics/#findComment-123454 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.