当我需要vote.php时,这是位于上载的vote.php的全部内容都消失了...

<?php
require 'db.php';
    $yesOrNo=$_POST['yesOrNo'];
if(isset($_POST['yesOrNo'])){
    header('location:index.php');
    if(!empty($yesOrNo)){
        $sqlv=$con->query("INSERT INTO votepoll (yesorno) VALUES ('{$yesOrNo}')");
    if($sqlv){


    }
    else{
        header('location:index.php');
    }
 }
}
?>

这是user.php中的表格
<form>
<input type="radio" name="yesOrNo" value="yes"><span style="font-family:none;font-size:22px">YES</span>
<input type="radio" name="yesOrNo" value="no"><span style="font-family:none;font-size:22px">NO<br>
</form>

最佳答案

缺少表单方法,php代码还可以。

<form method="POST">
<input type="radio" name="yesOrNo" value="yes"><span style="font-family:none;font-size:22px">YES</span>
<input type="radio" name="yesOrNo" value="no"><span style="font-family:none;font-size:22px">NO<br>
</form>

09-25 21:01