I am new to facebook app development. I want users to share contents from my website on their wall. I got share plugin code from facebook development docs. But when I embed that code, it shows social plugin related info on share window.
<div class="fb-share-button" data-href="https://developers.facebook.com/docs/plugins/" data-type="button_count"></div>
I think it is because data-href attribute value. If yes, then please help me to know how this attribute is used. If there is any other way to achieve this task, please let me know.
if you can find solution for PHP then this answer will help you:
Add this in html head section:
<meta property="og:title" content="Content titile" />
<meta property="og:image" content="image ulr path" />
<meta property="og:url" content="url of page" />
<meta property="og:description" content="your content" />
Add this in script:
<?php
$title=urlencode('Content title');
$url= urlencode('url of page');
$summary=urlencode("Content you can dynamically display like: (E.g.: Time:".(($usertime < 3600)?($usertime.' Seconds'): (round($usertime/60, 2))." Minutes, Points".$userscore.") ") );
$image=urlencode('image url path to display image');
?>
code for link button to share
<a onClick="window.open('http://www.facebook.com/sharer.php?s=100&p[title]=<?php echo $title;?>&p[summary]=<?php echo $summary;?>&p[url]=<?php echo $url; ?>&p[images][0]=<?php echo $image;?>','sharer','toolbar=0,status=0,width=550,height=300');" href="javascript: void(0)">