Adding “Current Page” Facebook Like Buttons to Your Website
The Facebook Like Button allows visitors on your website to quickly and seamlessly share your website’s content on their Facebook News Feed. If you would like to add the Facebook Like button to all of your website pages and have the URL and meta information picked up dynamically for that current page, you can implement XFBML (have fun!), or you can add a little PHP code into the standard Like button code.
If you’re using a CMS such as CMS Made Simple (CMSMS) or WordPress, it’s best to use a module/plug-in written for one of those platforms. Otherwise, here is an example of what you can do with PHP …
<iframe src="http://www.facebook.com/widgets/like.php?href=<?=urlencode("http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']); ?>&layout=standard&show_faces=false&width=450&action=like&font=arial&colorscheme=light&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe>

Wee Little Grasshopper


0 Comments