wamp,php,post不能获取表单数据 代码如下,使用get能获取到表单数据,而post获取不到表单数据,搜了好多帖子没解决问题求大神们给小白解惑啊! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <!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><?phpecho '<pre>';var_dump($_POST);echo '</pre>';?>注意事项: 1、form 中 methed属性 2、form 中 action 文件路径 ps:当前文件可不写 3. form 中 method 不是 methed 1中的method改了,还是有问题,两个文件都是notepad++写的,写了之后都放在wampsever的运行环境www目录下面的 还有在当前文件试过,也是get可以拿到表单的数据,而post就拿不到都是在notepad++写的文件,以后放到wamp/www目录下运行的, <html><meta charset="utf-8"><head><title color="red">调查问卷</title> </head><body><form name="form1" method="post" action="5.1.1.php"/>姓名:<input type="text" name="name" value="xingming"/></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> <html><meta charset="utf-8"><head><title>接受调查问卷</title><body><?php echo $_POST["name"];echo "你的性别是".$_GET["sex"];?> </body></head></html> 你看一下代码 ,谢谢<html><head> <meta charset="utf-8" /> <title color="red">调查问卷</title></head><body><form name="form1" method="post" action=""> 姓名: <input type="text" name="name" value="xingming" /> <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 type="submit" value="提交" align="center" /> <input type="reset" value="重写" align="center" /></form></body></html><?phpecho '<pre>';var_dump($_POST);echo '</pre>';?>新建一个.php文件 将代码放进入运行 如果出错把结果截图出来 你看一下代码 ,谢谢<html><head> <meta charset="utf-8" /> <title color="red">调查问卷</title></head><body><form name="form1" method="post" action=""> 姓名: <input type="text" name="name" value="xingming" /> <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 type="submit" value="提交" align="center" /> <input type="reset" value="重写" align="center" /></form></body></html><?phpecho '<pre>';var_dump($_POST);echo '</pre>';?>新建一个.php文件 将代码放进入运行 如果出错把结果截图出来没有报错了,下面用php输出的内容是array (size=3) 'name' => string 'xingming' (length=8) 'sex' => string '男' (length=3) 'xxjs' => string '' (length=0) 你看一下代码 ,谢谢<html><head> <meta charset="utf-8" /> <title color="red">调查问卷</title></head><body><form name="form1" method="post" action=""> 姓名: <input type="text" name="name" value="xingming" /> <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 type="submit" value="提交" align="center" /> <input type="reset" value="重写" align="center" /></form></body></html><?phpecho '<pre>';var_dump($_POST);echo '</pre>';?>新建一个.php文件 将代码放进入运行 如果出错把结果截图出来没有报错了,下面用php输出的内容是array (size=3) 'name' => string 'xingming' (length=8) 'sex' => string '男' (length=3) 'xxjs' => string '' (length=0) 这些数据就是POST的数据 这句话要怎么写? 四年php 求职(限北京)顺便撒分.大家捧场.谢谢. 问个用二维数组表示表格数据行列的问题? 谁能帮我在15天之内上手用PHP做项目.急!!! 【新新手问题】让页面等待1秒,再让页面刷新,应该如何做? 怎么扭曲图片? 类似百度文库,网页中某div内显示pdf文件,怎么搞? PHP的include问题(希望曾经有个这样问题的兄弟们一起讨论) php为什么连接不到远程数据库???? :| 对了,MYSQL支不支持存储过程来着? python写代码任意输入三角形两边求斜边长,代码是 谁能教我用php和mysql做这样的页面,有偿
<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>';
?>注意事项:
1、form 中 methed属性
2、form 中 action 文件路径 ps:当前文件可不写
都是在notepad++写的文件,以后放到wamp/www目录下运行的,
<meta charset="utf-8">
<head>
<title>
接受调查问卷
</title>
<body>
<?php echo $_POST["name"];
echo "你的性别是".$_GET["sex"];
?> </body>
</head>
</html>
<head>
<meta charset="utf-8" />
<title color="red">调查问卷</title>
</head>
<body>
<form name="form1" method="post" action="">
姓名:
<input type="text" name="name" value="xingming" />
<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 type="submit" value="提交" align="center" />
<input type="reset" value="重写" align="center" />
</form>
</body>
</html>
<?php
echo '<pre>';
var_dump($_POST);
echo '</pre>';
?>新建一个.php文件 将代码放进入运行 如果出错把结果截图出来
<head>
<meta charset="utf-8" />
<title color="red">调查问卷</title>
</head>
<body>
<form name="form1" method="post" action="">
姓名:
<input type="text" name="name" value="xingming" />
<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 type="submit" value="提交" align="center" />
<input type="reset" value="重写" align="center" />
</form>
</body>
</html>
<?php
echo '<pre>';
var_dump($_POST);
echo '</pre>';
?>新建一个.php文件 将代码放进入运行 如果出错把结果截图出来
没有报错了,下面用php输出的内容是
array (size=3)
'name' => string 'xingming' (length=8)
'sex' => string '男' (length=3)
'xxjs' => string '' (length=0)
<head>
<meta charset="utf-8" />
<title color="red">调查问卷</title>
</head>
<body>
<form name="form1" method="post" action="">
姓名:
<input type="text" name="name" value="xingming" />
<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 type="submit" value="提交" align="center" />
<input type="reset" value="重写" align="center" />
</form>
</body>
</html>
<?php
echo '<pre>';
var_dump($_POST);
echo '</pre>';
?>新建一个.php文件 将代码放进入运行 如果出错把结果截图出来
没有报错了,下面用php输出的内容是
array (size=3)
'name' => string 'xingming' (length=8)
'sex' => string '男' (length=3)
'xxjs' => string '' (length=0)