I have a function which looks like this:
function fullURL(){
$domain = $_SERVER['SERVER_NAME'];
$path = $_SERVER['PHP_SELF'];
$raw_url = $domain.$path;
$url = substr($raw_url, 0, -4);
echo $url;
}
This generates an URL which looks like 127.0.0.1/aura/profile
But, what if I would use this on a page which uses a $_GET-tag?
Then, my URL won't pick it up.
For example I have news?id=1
, when using the function above it just becomes 127.0.0.1/aura/news
.
What do I need to add to the function to make it output 127.0.0.1/aura/news?id=(id)
?