I'm wondering how i can get URL (the visible one in the bar). I have tried to google it, and lots of answers is to write this:
$url= "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
But it will get the path of the file you are in. I would like to just get the visible url, like this:
www.something.com/index.php?page=teams
And then only get the url that you can see, and not the included url. When i do this, ill get something like:
www.something.com/search.php
because im printing the URL inside the included file search.php.
I hope you understand my question, even though it's kinda bad written, i find it very hard to explain my problem.
for url : $_SERVER['REQUEST_URI']
after ? in url : $_SERVER['QUERY_STRING']
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With