Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php current page url

$protocol = strpos(strtolower($_SERVER['SERVER_PROTOCOL']),'https') === FALSE ? 'http' : 'https';
$host     = $_SERVER['HTTP_HOST'];
$script   = $_SERVER['SCRIPT_NAME'];
$params   = $_SERVER['QUERY_STRING'];
 
$currentUrl = $protocol . '://' . $host . $script . '?' . $params;
 
echo $currentUrl;
Source by phpf1.com #
 
PREVIOUS NEXT
Tagged: #php #current #page #url
ADD COMMENT
Topic
Name
6+5 =