20,359
社区成员
发帖
与我相关
我的任务
分享
<!-- 这里是method你写错了 -->
<form name="form1" methed ="POST" action="./index.php"/>
下面的代码
<?php
var_dump($_POST);
?>
<html>
<meta charset="utf-8">
<head>
<title color="red">调查问卷</title>
</head>
<body>
<form name="form1" method="POST" action="./index.php"/>
姓名:<input type="text" name="name"/></br>性别:
<input type="radio" name="sex" value="男" checked/>男
<input type="radio" name="sex" value="女"/>女</br>
你的爱好:</br><input type="checkbox" name="ah1" value="sang"/>唱歌</br>
<input type="checkbox" name="ah2" value="dance"/>跳舞</br>
<input type="checkbox" name="ah3" value="drink"/>喝酒</br>
<input type="checkbox" name="ah4" value="play"/>玩耍</br>
请输入你的详细介绍:</br><textarea name="xxjs" cols="50"rows="5"/></textarea></br></br>
<input name="submit" type="submit" value="提交" align="center"/>
<input type="reset" value="重写" align="center"/>
</form>
</body>
</html>
这是输出:
[/quote]
太感谢你了,刚刚另一个读者也给我指出了这个错误,我改了没弄好,后来解决了,本来想给你发消息说解决问题了的,可是这个APP一次最多只能回复三条,我回复不了了,实在太谢谢你们,给你们大佬点赞。谢谢,谢谢!
<!-- 这里是method你写错了 -->
<form name="form1" methed ="POST" action="./index.php"/>
下面的代码
<?php
var_dump($_POST);
?>
<html>
<meta charset="utf-8">
<head>
<title color="red">调查问卷</title>
</head>
<body>
<form name="form1" method="POST" action="./index.php"/>
姓名:<input type="text" name="name"/></br>性别:
<input type="radio" name="sex" value="男" checked/>男
<input type="radio" name="sex" value="女"/>女</br>
你的爱好:</br><input type="checkbox" name="ah1" value="sang"/>唱歌</br>
<input type="checkbox" name="ah2" value="dance"/>跳舞</br>
<input type="checkbox" name="ah3" value="drink"/>喝酒</br>
<input type="checkbox" name="ah4" value="play"/>玩耍</br>
请输入你的详细介绍:</br><textarea name="xxjs" cols="50"rows="5"/></textarea></br></br>
<input name="submit" type="submit" value="提交" align="center"/>
<input type="reset" value="重写" align="center"/>
</form>
</body>
</html>
这是输出:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<form action="" method="post">
姓名:<input type="text" name="name" value="<?php echo $_POST['name']?>"/>
<input type="submit" value="提交"/>
</form>
</body>
</html>
<?php
echo '<pre>';
var_dump($_POST);
echo '</pre>';
?>
替换掉你原本的代码运行下看