pranshu82202 Posted March 2, 2012 Share Posted March 2, 2012 I want to print the url of the webpage which i am accessing. Suppose i am accessing a page : "http://www.goooogle.com/view?id=5" I want this whole url to be printed or the whole url should be stored in the function. After googling all this a lot i found a function : $url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; But this method is not working too... Any help will be appreciated. Pranshu Agrawal [email protected] Quote Link to comment https://forums.phpfreaks.com/topic/258096-get-url/ Share on other sites More sharing options...
creata.physics Posted March 2, 2012 Share Posted March 2, 2012 Are you even echoing the code? It works just fine for me. print "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; Quote Link to comment https://forums.phpfreaks.com/topic/258096-get-url/#findComment-1323030 Share on other sites More sharing options...
pranshu82202 Posted March 2, 2012 Author Share Posted March 2, 2012 @creata.physics No, i just want to echo the url, the excat url i.e. "http://www.goooogle.com/view?id=5" But the variable i gave just echo "http://www.goooogle.com/" Quote Link to comment https://forums.phpfreaks.com/topic/258096-get-url/#findComment-1323033 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.