EchoFool Posted January 26, 2008 Share Posted January 26, 2008 I have a major problem with using this as a way to test what page a user is on. The problem with it is say i do this: If($_SERVER['PHP_SELF'] == 'test.php') But the user for a joke puts TEST.php then the if statement fails because its case sensitive.. how can i make it only care about the characters rather than the case sensitivity aswell ? Quote Link to comment https://forums.phpfreaks.com/topic/87852-solved-urgent-help-with-dirname-for-_serverphp_self/ Share on other sites More sharing options...
themistral Posted January 26, 2008 Share Posted January 26, 2008 Try If(strtolower($_SERVER['PHP_SELF']) == 'test.php') This will convert the page name of $_SERVER['PHP_SELF'] to lowercase. Quote Link to comment https://forums.phpfreaks.com/topic/87852-solved-urgent-help-with-dirname-for-_serverphp_self/#findComment-449418 Share on other sites More sharing options...
EchoFool Posted January 26, 2008 Author Share Posted January 26, 2008 ok ill try it. Quote Link to comment https://forums.phpfreaks.com/topic/87852-solved-urgent-help-with-dirname-for-_serverphp_self/#findComment-449420 Share on other sites More sharing options...
EchoFool Posted January 26, 2008 Author Share Posted January 26, 2008 works! Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/87852-solved-urgent-help-with-dirname-for-_serverphp_self/#findComment-449421 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.