Htaccess 表单 POST 不起作用?
我有一个带有重定向到页面的操作的表单;
“active”页面是重写的规则;RewriteRule ^active$ active_form-sec.php
带有表单的页面也是一个RewriteRule。
问题是,每次我提交表单并进入活动页面时,POST 都是空的。
我该如何解决这个问题?
提前致谢!
I have a form with an action that redirects to a page;<form method="post" action="active">
The "active" page is a rewritten rule;RewriteRule ^active$ active_form-sec.php
The page with the form is also a RewriteRule.
The problem is, everytime I submit the form and I get on the active page, the POSTs are empty.
How can I fix this problem?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
active_form-sec.php
吗?print_r($_POST)
时,你会得到什么?active-form-sec.php
没有被调用,你的 mod_rewrite 就无法正常工作name
属性)调试完成。
active_form-sec.php
is called when you hit the submit button?print_r($_POST)
?active-form-sec.php
isn't called, your mod_rewrite isn't working properlyname
attributes)Debug done.
这可能是因为 .htaccess 不收集表单数据。
为什么不这样做:
that's probably because the .htaccess doens't collect the form data.
Why not doing it like this:
这可能会有所帮助:
.htaccess:
form.php:
posting.php:
我已经尝试过此代码它有效。
This may help:
.htaccess:
form.php:
posting.php:
I have tried this code and it works.