jaylearning Posted December 6, 2007 Share Posted December 6, 2007 Thanks in advance for looking. i have two pages index.php and test.php on index.php page i have that link. <a href="test.php?url=yes">test.php</a> ------------------------------------------ and on test.php i have <? $url = $_SERVER['REQUEST_URI']; if($url== '/naz/test.php'){ echo "its working!"; }else { echo "something is wrong!"; die(); } ?> when i click on the link its supposed to say "its working!" but it always says "something is wrong!" can you please tell me what im doing wrong? Quote Link to comment https://forums.phpfreaks.com/topic/80467-solved-_serverrequest_uri-help/ Share on other sites More sharing options...
pocobueno1388 Posted December 6, 2007 Share Posted December 6, 2007 Try to echo out $url and see what you get. Quote Link to comment https://forums.phpfreaks.com/topic/80467-solved-_serverrequest_uri-help/#findComment-407953 Share on other sites More sharing options...
pocobueno1388 Posted December 6, 2007 Share Posted December 6, 2007 Okay...your saying if your URL looks like "'/naz/test.php" you want it to say "its working!". But when you click the link, your URL is going to look like "/naz/test.php?url=yes"...so that IF statement will never be true. Quote Link to comment https://forums.phpfreaks.com/topic/80467-solved-_serverrequest_uri-help/#findComment-407960 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.