Facebook iframe like issue


Facebook iframe like issue

我有一个问题与Facebook像iframe..我想给每个id点赞。问题是,当我把这段代码放在我的网站上,并点击喜欢在一个帖子,所有的帖子都喜欢。

    $sql = "SELECT * FROM $tbl_name ORDER BY id DESC LIMIT $start, $limit";
if(isset($_GET['id']))
    {
    $id=intval($_GET['id']);
    $sql = "SELECT * FROM $tbl_name WHERE id=$id";
    }
$result = mysql_query($sql);
        while($row = mysql_fetch_array($result))
    {
    echo "<center><a href ='single_joke.php?id=".$row['id']."'>" .$row['Title']."</a></center>";
    echo "<br>";
    echo nl2br($row["VicText"]);
    ?>
    <iframe src="https://www.facebook.com/plugins/like.php?href=http://www.keevik.com/vicevi.php?id=<?php echo $row['id']; ?>"
    scrolling="no" frameborder="0"
    style="border:none; width:450px; height:80px"></iframe>
    <?php
    echo "<hr>";
    }

然而,你需要urlencode()你的URL,因为如果你在你的URL中添加第二个参数,http服务器解释这第二个参数像facebook URL的参数,不为你的;)