尝试提交此表单时,我一直收到404错误.在我的网站目录中,我有一个名为mobile的文件夹,里面有forms.PHP和process.PHP.
表单位于此页面上
http://localhost/mobile/forms.PHP?ft=0&id=2
这是表格
<form action='/mobile/process.PHP?o=9&ft=0' method='POST'> //details </form>
当我尝试提交时我得到404错误,当它应该转到http://localhost/mobile/process.PHP?o = 9& ft = 0?我该如何解决?
通过查看URL我得出的结论是两个PHP文件都在同一页面上,所以改变你的动作网址
原文链接:https://www.f2er.com/php/139167.html<form action='/mobile/process.PHP?o=9&ft=0' method='POST'>
至
<form action='process.PHP?o=9&ft=0' method='POST'>
移动设备之前的正斜杠意味着它从根目录中选择文件夹..所以你可能不需要这里.
最后但并非最不重要的是,确保文件名正确,并确保案例相同,因为文件名区分大小写.
Note: You may also get 404 error if you are using
header('Location:
on the form processing page,for redirecting the user to
xyz.PHP');
some page after the form processes and you may encounter404
because
the page on which the script has redirected doesn’t exist. so make sure
that the URL is correct if you are usingheader()