Facebook like with dynamic URLs - PHP



  • function curPageURL() {
    		$isHTTPS = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on");
    		$port = (isset($_SERVER["SERVER_PORT"]) && ((!$isHTTPS && $_SERVER["SERVER_PORT"] != "80") || ($isHTTPS && $_SERVER["SERVER_PORT"] != "443")));
    		$port = ($port) ? ':'.$_SERVER["SERVER_PORT"] : '';
    		$url = ($isHTTPS ? 'https://' : 'http://').$_SERVER["SERVER_NAME"].$port.$_SERVER["REQUEST_URI"];
    					return $url;
    		}
    
    echo '';
    
    

Log in to reply
 

© 2108 H7 | Powered by NodeBB

Looks like your connection to H7 was lost, please wait while we try to reconnect.