sphinx Posted January 30, 2013 Share Posted January 30, 2013 Hi. I used to have the code for this, but i cant backtrack on my previous posts. What can I use to do the following: http://website.com/index.php?error to Display error content on page http://website.com/index.php?welcome To display welcome content on page Thanks Quote Link to comment https://forums.phpfreaks.com/topic/273844-content-based-on-url-same-file/ Share on other sites More sharing options...
Jessica Posted January 30, 2013 Share Posted January 30, 2013 if(isset($_GET['error'])){...} Quote Link to comment https://forums.phpfreaks.com/topic/273844-content-based-on-url-same-file/#findComment-1409237 Share on other sites More sharing options...
requinix Posted January 30, 2013 Share Posted January 30, 2013 (edited) Look at the $_SERVER["QUERY_STRING"]. [edit] Jessica's is better. Even though it's missing the equals sign using ?error is treated just like ?error=: $_GET["error"] == "". Edited January 30, 2013 by requinix Quote Link to comment https://forums.phpfreaks.com/topic/273844-content-based-on-url-same-file/#findComment-1409240 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.