user2308737
user2308737

Reputation: 3

Facebook iframe like issue

I have a problem with Facebook like iframe.. I want to be able to like every id. The problem is when I put this code on my site, and click like on one post, all posts are liked.

    $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>";
    }

Upvotes: 0

Views: 94

Answers (1)

AFrenchDev
AFrenchDev

Reputation: 151

however, you need to urlencode() your URL because if you add a second parameter in your URL, http server interprete this second parameter like a parameter for facebook URL, no for your ;)

Upvotes: 1

Related Questions