表单POST数据未传递到PHP
我不明白为什么我的代码不起作用。我已经发了一百万次帖子,但这次好像不起作用 我的表格:表单POST数据未传递到PHP,php,forms,query-string,Php,Forms,Query String,我不明白为什么我的代码不起作用。我已经发了一百万次帖子,但这次好像不起作用 我的表格: <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="pa
<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>
我每次都会“失败”。我做错了什么?我就是看不见。删除enctype=“text/plain”
然后像这样检查
<form method="post" name="form" id="form" 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>
按enter键提交
enctype定义数据在发送前应如何格式化。两种正确的格式是application/x-www-form-urlencoded
(它基本上以key=valye&anotherkey=anothervalue的形式发送东西,带有http头)和multipart/form data
(它将每个键拆分为不同的数据部分)text/plain
意味着什么都不应该做-它的行为在浏览器之间基本上没有定义,并且在垃圾邮件之前的几天中只用于自动电子邮件表单。删除enctype=“text/plain”
并进行类似检查
<form method="post" name="form" id="form" 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>
按enter键提交
enctype定义数据在发送前应如何格式化。两种正确的格式是application/x-www-form-urlencoded
(它基本上以key=valye&anotherkey=anothervalue的形式发送东西,带有http头)和multipart/form data
(它将每个键拆分为不同的数据部分)text/plain
意味着什么都不应该做-它的行为在浏览器之间基本上没有定义,并且在垃圾邮件之前的几天中只用于自动电子邮件表单。从它将提交的表单中删除enctype=“text/plain”
<form method="post" name="form" id="form" 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>
按enter键提交
从它将提交的表单中删除enctype=“text/plain”
<form method="post" name="form" id="form" 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>
按enter键提交
我同意@Gautam3164
<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>
按enter键提交
变成
<form method="post" name="form" id="form" 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>
按enter键提交
也可以参考这个我同意@Gautam3164
<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>
按enter键提交
变成
<form method="post" name="form" id="form" 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>
按enter键提交
也请参阅此Remove
enctype=“text/plain”
并检查,谢谢您。那完全正确。我的脑子坏了,我该睡觉了。谢谢。为什么有人要添加enctype=“text/plain”
?没有任何意义?删除enctype=“text/plain”
并选中,谢谢你。那完全正确。我的脑子坏了,我该睡觉了。谢谢。为什么有人要添加enctype=“text/plain”
?没有任何意义?