关于重定向为 POST
我想将用户重定向到其他网站中的某个网址,但要与他的重定向一起发送一些帖子变量..这可能吗?如果是,怎么办?
谢谢。
I want to redirect the user to some url in other website, but to send with his redirect some post variable.. is this possible? And if yes, how?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它不是。 :(
但是,您可以使用 Javascript 提交隐藏表单。
编辑:我真丢脸。似乎无需 Javascript 即可实现。尝试将一些数据发布到您自己编写的 PHP 页面,这基本上告诉浏览器执行
303 See Other
重定向,从某种意义上说,浏览器应该在重定向目标上重新发布数据,但有人报告这会导致浏览器显示“真的重新发布数据吗?”就像您刷新使用 POST 加载的网页时看到的那样,但是,即使它有效,我认为也没有人这样做。
It is not. :(
You can however submit an hidden form using Javascript.
EDIT: shame upon me. It seems it can be achieved w/o Javascript. Try to post some data to a PHP page you write yourself, which basically tells the browser to do a
303 See Other
redirect. It shall work, in the sense that the browser should re-POST the data on the redirection target, but someone reports this causes the browser to show a "really repost the data?" message, like the one you see if you refresh a web page you loaded with a POST.However, even if it works, I think nobody does it.