[PHP] I can't code today to save my life! :(
I have $REQUEST_URI that will take two values: /event/login.php and /event/register.php What I need to do is so simple it's brainless!!! I need to look into $REQUEST_URI and find if it contains register.php. I tried this and it completely failed, the results were wrong every time: if (strpos($REQUEST_URI, register.php) !== 0) { // you're in login.php } I don't know why I can't get this other than weekend stupidity, can someone help? Thanx Phil
Re: [PHP] I can't code today to save my life! :(
At 22:21 4-1-2003, you wrote: completely failed, the results were wrong every time: if (strpos($REQUEST_URI, register.php) !== 0) { // you're in login.php } try if (!strpos($REQUEST_URI, register.php) === FALSE) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I can't code today to save my life! :(
try if(stristr($_SERVER['REREQUEST_URI'], register.php){ echo at register; } else { echo Not; } Not tested but should work.. also case insensitive now... *** REPLY SEPARATOR *** On 04/01/2003 at 4:21 PM Phil Powell wrote: I have $REQUEST_URI that will take two values: /event/login.php and /event/register.php What I need to do is so simple it's brainless!!! I need to look into $REQUEST_URI and find if it contains register.php. I tried this and it completely failed, the results were wrong every time: if (strpos($REQUEST_URI, register.php) !== 0) { // you're in login.php } I don't know why I can't get this other than weekend stupidity, can someone help? Thanx Phil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I can't code today to save my life! :(
I must be doibg drugs with all those typos... Typos removed: ?php if(stristr($_SERVER['REQUEST_URI'], register.php)){ echo at register; } else { echo Not; } ? *** REPLY SEPARATOR *** On 04/01/2003 at 4:43 PM Michael J. Pawlowsky wrote: try if(stristr($_SERVER['REREQUEST_URI'], register.php){ echo at register; } else { echo Not; } Not tested but should work.. also case insensitive now... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php