Jump to content

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>

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.