surfwtw Posted July 16, 2011 Share Posted July 16, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/242137-facebook-like-button/ Share on other sites More sharing options...
surfwtw Posted July 16, 2011 Author Share Posted July 16, 2011 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> Quote Link to comment https://forums.phpfreaks.com/topic/242137-facebook-like-button/#findComment-1243545 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.