我如何获得正确的价值

时间:2019-08-29 12:23:48

标签: php html radio

计数器不会上升。如您所见,如果PHP代码收到A值,则计数器应该上升。

html:

 <body>
    <div>
      <div>
         <h1>Login</h1>
         <form method="post" action="quiz.php">
         <input name="A" value="A" type="radio">
              <label for="A">A</label>
         <input name="A" value="B" type="radio">
              <label for="A">B</label>
         <input name="A" value="C" type="radio">
              <label for="A">C</label>
         <button id="submitbutton" 
     type="submit">Antworten</button>
    </form> 
    </div>
    </div>
    </body>


<?php
    if(!empty($_POST)) {
        if(!empty($_POST['A'])) {
            $counter = $counter + 1;
        }
    }
    echo $counter;

    ?>

有时我会收到HTTP错误412

0 个答案:

没有答案
相关问题