资 源 简 介
Facebook social plugins are widely used to promote website, blog posts etc. In this post I am going to tell you how to dynamically create Facebook share button in PHP and how to populate and open Facebook share in a popup window so user can stay on the same page while sharing to Facebook. Meta tags will be used to populate the share. Title, description, link and image will be provided to share to Facebook.
Are you ready to start? Here we go.
Lets start with the Facebook share button, to create a Facebook share button you need two things first is the share button image and second is the unique url that is used by facebook to fetch the data from. For unique url we use fbsharepage.php page with the query string parameter that is id to make it unique, id can be a number or a string if you use a database then you can use primary key as an id because it is always unique.