lundi 2 mars 2015

facebook share button code not working

facebook share button not showing in this code why ? qfter click share button Shows me only localhost Do not give me the picture and title and description



<?php
session_start();
$cid = (int)$_GET['id'];

require 'config.php';
$ans = mysql_query("select * from `result` where `cat_id`='".$cid."' order by RAND() limit 1");
$rowans = mysql_fetch_object($ans);


?>
<html lang="en">
<head>
<meta charset="utf-8">
<title><?php echo $rowans->title; ?></title>
<meta property='og:title' content='<?php echo $rowans->title; ?>'/>
<meta property='og:type' content='Quiz'/>
<meta property='og:url' content='http://localhost/myjob/new_quiz/result.php?id=$cid'/>
<meta property='og:image' content='<?php echo $rowans->img; ?>'/>
<meta property='og:site_name' content='Quiz Test'/>
<meta property='og:description' content='<?php echo $rowans->desc; ?>'/>

<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/fr_FR/sdk.js#xfbml=1&appId=800271143322806&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
</head>
<body>

<?php

echo"
<div>
<p>".$rowans->title."</p>
<img src='".$rowans->img."' />
<p>".$rowans->desc."</p>
</div>
";

?>
<div id="fb-root"></div>
<div class="fb-share-button" data-href="http://localhost/myjob/new_quiz/result.php?id=<?php echo $cid; ?>" data-layout="button_count"></div>


</body>
</html>


Do not give me the picture and title and description


Aucun commentaire:

Enregistrer un commentaire