Live Streaming

Full Version: Facebook like with dynamic URLs - PHP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
PHP Code:
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 
'<div class="facebook_like">
                        <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="'
.curPageURL().'" show_faces="false" width="260"></fb:like>
      </div>'