Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Facebook like with dynamic URLs - PHP
02-22-2011, 03:15 PM
Post: #1
Facebook like with dynamic URLs - PHP
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>'


I Heart chatroulette
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)