<?php
// Get The Current Page URL with PHP $_SERVER.
$fullurl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ?
"https" : "http") . "://" . $_SERVER['HTTP_HOST'] .
$_SERVER['REQUEST_URI'];
echo $fullurl;
?>