【发布时间】:2013-09-07 12:12:52
【问题描述】:
我很困惑为什么我的代码不起作用。我已经发布了一百万次,但这次似乎不起作用。
我的表格:
<form method="post" name="form" id="form" enctype="text/plain" action="../posts/">
<fieldset id="inputs" style="text-align: center;">
<input id="password" type="password" name="password" placeholder="enter password" required />Press enter to submit
</fieldset>
</form>
我用于检索的 PHP 代码:
if(isset($_POST['password'])){
echo "success";
}
else{
echo "fail";
}
我每次都“失败”。我究竟做错了什么?就是看不出来。
【问题讨论】:
-
删除
enctype="text/plain"并检查 -
呃,谢谢 Gautam3164。那是完全正确的。我的大脑被炸了,我该睡觉了。谢谢。
-
为什么有人加
enctype="text/plain"?没有任何意义?
标签: php forms query-string