2825 explained code solutions for 75 technologies


phpGet current URL


$url = 'http' . ($_SERVER['HTTPS'] == 'on' ? 's' : '') . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];ctrl + c
$url

will contain current URL

$_SERVER['HTTPS'] == 'on'

if this is true, then we have secure HTTPS link

HTTP_HOST

this will contain current domain

REQUEST_URI

link path (everything after domain name)