$url = (($_SERVER["HTTPS"] == "off" || empty($_SERVER["HTTPS"])) ? "http://" : "https://") . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
http://tr.lucb1e.com/randomprojects/geturl.php