phpfacebook-likefacebook-page

How to implement Facebook page like from my site, in a PHP site?


I want to get likes to my Facebook page through my PHP website. How to implement that?

I tried below code:

<iframe src="http://www.facebook.com/plugins/like.php?href=
<?php echo $pageurl;?>&amp;layout=button_count&amp;show_faces=false&amp;
width=100&amp;action=like&amp;font&amp;colorscheme=light&amp;height=21" 
scrolling="no" frameborder="0" style="border:none; overflow:hidden; 
width:100px; height:21px;" allowTransparency="true"></iframe>

It works fine but this is not what I required. I need my Facebook page to get liked from my site.


Solution

  • Go to this page https://developers.facebook.com/docs/plugins/page-plugin and add the link of your Facebook page. Then click on Get Code button which generates the code for you.

    You can customize the appearance in various ways by checking on different options.

    You need to put the generated code in appropriate locations of your website.