无需 JavaScript 即可触发 HTML POST/表单提交
我有一个定时页面,我需要使用它在指定时间段结束时提交表单。
用法是:用户访问页面,90 秒后提交所有表单数据,并将用户重定向到下一页。
用户很清楚他们所在的页面是定时的(仅用于网络实验),因此我并不担心该页面上的“不友好”浏览器行为。
理想情况下,我希望避免使用 JavaScript(我们的一些目标用户出于各种原因使用无脚本,但如果这是唯一的方法,那就这样吧),并且还希望避免仅通过 URL 传递变量(以减少欺骗的可能性)。 设置 META 刷新标记来执行重定向很容易,但是在时间段结束时,我需要某种方法来设置响应标头,就像单击了提交按钮一样,无论是否实际单击了。
预先感谢您的任何想法。
I have a timed page that I need to use to submit a form upon the end of a specified time period.
The usage would be: User visits page, 90 seconds later all form data is submitted and user is redirected to next page.
The user is well aware that the page they are on is timed (its for a web-only experiment), so I'm not worried about "unfriendly" browser behavior on this page.
Ideally, I'd like to avoid using JavaScript (some of our targeted users are using no-script for various reasons, but if its the only way, so be it), and would also like to avoid just passing variables through the URL (to cut down on the possibility of spoofing). It is easy enough to set a META refresh tag to do the redirecting, but at the end of the time period I need some way for the response header to be set as if the submit button was clicked, whether or not it actually was.
Thanks in advance for any thoughts you might have.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
做不到。
Can't be done.