First you need to create an application to get the application id
https://developers.facebook.com/apps
Secondly, you must create the code for your button: https://developers.facebook.com/docs/reference/plugins/like/ OR use the following code:
You need to place your html tag like this:
<html lang="pt" xmlns:fb="http://www.facebook.com/2008/fbml">
And between <body> and </body> you need to put the following code
<fb:like href="http://www.your.page.url" layout="standard" show-faces="true" send="true" width="450" action="like" colorscheme="light"></fb:like> <div id="fb-root"></div> <script type="text/javascript"> window.fbAsyncInit = function() { FB.init({appId: 'your-facebook-app-id', status: true, cookie: true, xfbml: true}); }; (function() { var e = document.createElement('script'); e.type = 'text/javascript'; e.src = document.location.protocol + '//connect.facebook.net/pt_PT/all.js'; e.async = true; document.getElementById('fb-root').appendChild(e); }()); </script>
don't forget to replace "http: //www.your.page.url" and "your-facebook-app-id" with the correct values.
source share