0

我正在尝试建立一个 Youtube 视频社区投票网站。发布的每个视频都有一个 LIKE 和 DISLIKE 按钮 - 但我不知道如何获取喜欢的视频并将其与视频的 ID 相关联。这是我列出现有视频的代码:

<div class="row">
<?php
while ($row = mysqli_fetch_assoc($result)){
extract($row);
echo "<div class='span4'>";
    echo "<p>Username: " . $username . "</p>";
     echo "<p>Title: " . $title . "</p>";
     echo "<p>Description: " . $description . "</p>";
     echo "<p>Likes: " . $thumbUp . "</p>";
     echo "<p>Dislikes: " . $thumbDown . "</p>";

     echo "<form action='$_SERVER[PHP_SELF]' method='POST'>";
     echo "<input type='submit' name='like' value='Like' class='btn' />";
     echo "<input type='submit' name='dislike' value='Disike' class='btn' />";
     echo "</form>";
     echo "</div>";
     echo "<div class='span8'>";
?>
<iframe width='560' height='315' src='http://www.youtube.com/embed/<?php echo($url); ?>?rel=0' frameborder='0' allowfullscreen></iframe>
<?php
    echo "</div>";
}
?>  
</div>

我正在尝试使用 if(isset($_POST[like])) 但无法弄清楚如何获取视频 ID。有任何想法吗?

4

0 回答 0