html post form action 没有具体拼出 php 文件吗?
我有一个 post html 表单,操作是index.php,这是网站的主页。我的地址栏中实际上从来没有index.php,因为指向“/”的链接会指向它,即使我这样做了,它也会是website.com/home(/),因为我使用重写规则。所以基本上,用户永远不应该看到index.php。然而,如果操作不是特定的index.php,则表单提交不起作用,“/”不起作用,即使它解析为index.php。关于如何解决这个问题有什么想法吗?
I have a post html form, and the action is index.php, which is the websites main page. I never actually have index.php in the address bar, since links to "/" go to it, and even if I did, it would be website.com/home(/), since I use rewrite rules. So basically, the user should never see index.php. However, the form submit doesn't work if the action isn't spefically index.php, "/" doesn't work, even though that resolves to index.php. Any ideas on how to get around this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不要指定操作。如果帖子发布到他们所在的页面,则表单的默认操作是发布到该页面。
Don't specify the action. If the post is to the page they're on, the default action of the form is to post to that.