How to post to Facebook using PHP

I have 5 divs in my program and in each div, it contains different content and is divided by the Fb button. Now, when I click on this button, I need to share this specific content on FB. Can someone please tell me how to do this?

+6
source share
3 answers

There are two ways. The links below may help you. I use the code from this article.

1) Using javascript:

http://thinkdiff.net/facebook/new-javascript-sdk-oauth-2-0-based-fbconnect-tutorial/

2) graphics API

http://thinkdiff.net/facebook/php-sdk-3-0-graph-api-base-facebook-connect-tutorial/

+9
source

FB php SDK> https://developers.facebook.com/docs/reference/php/

This is the complete FB documentation for their PHP api ..

+1
source

try it

<?php $title=urlencode('Dressfinity'); $url=urlencode('http://www.facebook.com/pages/Dressfinity-LLC/208406062583392 '); $image=urlencode('http://livemarketnews.com/dressfinity/skin/frontend/default/default/images/logo.jpg'); ?> <a onClick="window.open('http://www.facebook.com/sharer.php?s=100&amp;p[title]=<?php echo $title;?>&amp;p[url]=<?php echo $url; ?>&amp;&p[images][0]=<?php echo $image;?>', 'sharer', 'toolbar=0,status=0,width=548,height=325');" target="_parent" href="javascript: void(0)"> Share our Facebook page! </a> 

For each div.

thanks

+1
source

All Articles