Jump to content

Facebook Like Button


surfwtw

Recommended Posts

Does anyone know how to make a facebook like button like the url in the address bar.  I have a page that displays terms out of mysql but I need the facebook like code to pull the url out of the address bar so it knows what url to share.

 

basically I have one page that displays all the data so there is no way that I can place the traditional facebook like button on that page. I need a facebook like button that likes the url in the address bar.

Link to comment
https://forums.phpfreaks.com/topic/242137-facebook-like-button/
Share on other sites

I figured it out.  The code is below for anyone who might need it in the future.  This code allows you to place a like button on the template display page and it will refer the address bar for the url to like and share.

 

 

 

<?php $fb_url = urlencode("http://www.yourwebsite.info/yourdisplaypage.php?id=$id");?>

 

<iframe src="http://www.facebook.com/plugins/like.php?app_id=??????????&href=<?php print $fb_url;?>&send=false&layout=standard&width=450&show_faces=false&action=like&colorscheme=light&font=lucida+grande&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.