在notepad++里面写的php文件,放到wamp/www目录下运行,在使用表单时get能获取到表单值,而post不能获取到。求大神解决
解决方案 »
- 谁会写wap站
- discuz论坛整合,做到和论坛同步登录、同步注册、注销
- 请教高手个关于DISCUZ的问题
- 有用过DedeCMS淘宝客的么?模块安装后无法加载CSS,路径正确就是无法显示
- php怎么调用其他类得方法?
- 【求教】请教高手怎样才能将生成的验证码放到session中?在线等待...
- RewriteRule 这个规则怎么配置?
- 请教一个服务器购买的问题
- 新人求助,.chm文件打不开,双击就弹出一个乱码窗口,求解决方案
- 关于php接收post的json数据
- thinkphp框架加密了域名,打开就跳转到绑定的域名,无法修改!修改后打开就是502 Bad Gateway
- PHP怎么读取word里面的内容 只要要文字都可以
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>
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>
这个是php代码,
<html>
<meta charset="utf-8">
<head>
<title>
接受调查问卷
</title>
<body>
<?php
echo $_POST["name"];
echo "你的性别是".$_GET["sex"];
?>
</body>
</head>
</html>
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>
这个是php代码,
<html>
<meta charset="utf-8">
<head>
<title>
接受调查问卷
</title>
<body>
<?php
echo $_POST["name"];
echo "你的性别是".$_GET["sex"];
?>
</body>
</head>
</html>
运行出来是这样的,post得到的值显示警告,而get能获取到值
( ! ) Notice: Undefined index: name in D:\wamp\www\5.1.1.php on line 9
Call Stack
# Time Memory Function Location
1 0.0005 242160 {main}( ) ..\5.1.1.php:0
你的性别是男
<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>';
?>替换掉你原本的代码运行下看
会显示这个错误
( ! ) Parse error: syntax error, unexpected '?' in D:\wamp\www\first.PHP on line 19
我看了一下代码 。。 气死了让你。。 !
<!-- 这里是method你写错了 -->
<form name="form1" methed ="POST" action="./index.php"/>下面的代码<?phpvar_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>这是输出:
我看了一下代码 。。 气死了让你。。 !
<!-- 这里是method你写错了 -->
<form name="form1" methed ="POST" action="./index.php"/>下面的代码<?phpvar_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>这是输出:
太感谢你了,刚刚另一个读者也给我指出了这个错误,我改了没弄好,后来解决了,本来想给你发消息说解决问题了的,可是这个APP一次最多只能回复三条,我回复不了了,实在太谢谢你们,给你们大佬点赞。谢谢,谢谢!