亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

PHP? ??? ?? ??? ?? ??? ?? ??? ?????(1)

116.png

??? ?? 123 ?? ?? ??? ??? ???? "??"? ???? ? ????? ?? ?? ? ?? ?????.

<input> ??? ?? ??? ??? ?? ??? ?????.

<input type="radio" name="itm" value="<?php echo $rows["id"]?>" />

SQL? ???? ?? ?? ??? ??? ????? ??????? ?????.

<?php
$SQL="SELECT * FROM vote";
$rs=mysqli_query($link,$sql);
while($rows=mysqli_fetch_assoc($rs))
{
  ?>
  <tr>
    <td bgcolor="#FFFFFF"><input type="radio" name="itm" value="<?php echo $rows["id"]?>" />&nbsp;&nbsp;
      <?php echo $rows["item"]?></td>
  </tr>
  <?php
}
?>

"??" ??? ????

<input type="submit" name="submit" value="投票"/>

???? ?? ??? ?????. ???? ??? ??? ???? ?? ????? ?? ??? ? ??? ?????.

??? ?? ?? ?? ??? ??? ? ??? ????? ?? ?? ? ?? ???? ???? ??????? ?? ?? ???? ?????.

<?php
if(isset($_POST["submit"])){

  if($_SESSION["vote"]==session_id())
  {
    ?>
    <script language="javascript">
      alert("您已經(jīng)投票了");
      location.href="index.php";
    </script>
  <?php
  exit();
  }
  $id=$_POST["itm"];
  $sql="update vote set count=count+1 where id=$id";
}
?>


???? ??
||
<?php if(isset($_POST["submit"])){ if($_SESSION["vote"]==session_id()) { ?> <script language="javascript"> alert("您已經(jīng)投票了"); location.href="index.php"; </script> <?php exit(); } $id=$_POST["itm"]; $sql="update vote set count=count+1 where id=$id"; } ?>