<?php
$kurl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
echo $kurl."<br>";
echo $_SERVER['HTTP_HOST']."<br>";
echo $_SERVER['REQUEST_URI']."<br>";
Details
//(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") - Detect https/http
//$_SERVER['HTTP_HOST'] - Detect domain name
//$_SERVER['REQUEST_URI'] - Detect page url
?>
0 Comments