I am new to this site.
The reason I said, "Dynamic.." is because, I know how to create the like button, but that is for one page. But, I am building a news website and instead of manually entering the Facebook code on each news and article, I would like that to happen automatically on the new and dynamically-created pages so I won't have to put them each time I publish an Article on the page.
Usually my pages URL will be like www.site.com/articles.php?id=12
So the id, is the only thing it changes, so I don't know what to do after that.
You need to replace the URL in your embed code. like
<div class="fb-like" data-href="<?=$current_url?>" data-send="true" data-width="450" data-show-faces="true"></div>
All you need to replace $current_url
variable with appropriate url
However, if you omit the the data-href
it will use the current URL (XFBML version).
Welcome to stack overflow!
See http://developers.facebook.com/docs/reference/plugins/like/
Simply enter the URL of your page (http://www.site.com/articles.php?id=12) and click 'Get Code'. A popup with instructions will appear. Then, for your other pages, when you embed the code for the like button you simply need to change the 'href' parameter to be the URL of the article you are displaying.