I'm trying to get the full url together with all the query strings of this url
http://localhost/test/searchprocess.php?categ=vessel&keyword=ves&search-btn=Search&page=5
I tried to use this function but it doesn't give me all of the query strings. It only saves the first query string.
function getCurrentURL() {
$currentURL = (@$_SERVER["HTTPS"] == "on") ? "https://" : "http://";
$currentURL .= $_SERVER["SERVER_NAME"];
if($_SERVER["SERVER_PORT"] != "80" && $_SERVER["SERVER_PORT"] != "443") {
$currentURL .= ":".$_SERVER["SERVER_PORT"];
}
$currentURL .= $_SERVER["REQUEST_URI"];
return $currentURL;
}
When I echo getcurrentURL();
it only gives me http://localhost/test/searchprocess.php?categ=vessel
How can I be able to get the full url?