我该怎么办?研究“评论[]”据说以这种方式使用。我这样做时会出错
$ comment = post(“comment”);
<input type="radio" value="1" name="comment">
<label for="comment"> Yes</label>
<input type="radio" value="2" name="comment">
<label for="comment"> No</label>
答案 0 :(得分:0)
HTML
<form action="your_php.php" method="post">
<input type="radio" value="1" name="comment">
<label for="comment"> Yes</label>
<input type="radio" value="2" name="comment">
<label for="comment"> No</label>
<input type="submit" value="Submit" />
</form>
<强> your_php.php 强>
<?php
if(isset($_POST["comment"])) {
$comment = $_POST["comment"];
}
print_r($comment);
?>