阻止某人重新加载页面

编程入门 行业动态 更新时间:2024-10-25 00:29:08
本文介绍了阻止某人重新加载页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

是否有一种方法可以在php或html中禁用后面和/或重新加载/刷新浏览器,这样潜在的垃圾邮件发送者就不能再保持清爽了 发送确认电子邮件的表单页面 提前感谢

is there a way in either php or html to disable the back and or the reload/refresh on a browser so a potential spammer cant just keep refreshing the page of a form that sends a confirmation email out thanks in advance

推荐答案

chris写道: chris wrote: 在php或html中是否有一种方法可以禁用后退和/或在浏览器上重新加载/刷新,这样潜在的垃圾邮件发送者就无法继续刷新发送确认电子邮件的表单页面 is there a way in either php or html to disable the back and or the reload/refresh on a browser so a potential spammer cant just keep refreshing the page of a form that sends a confirmation email out

这是Web应用程序中非常常见的问题。有不同的 解决方案: - 拥有成功发送的解决方案页面重定向到另一个页面(比如返回 到我们来自哪里),所以垃圾邮件发送者必须抓住1秒 时间窗才能点击F5。 br /> - 在表单的隐藏字段中包含uniqid(),因此系统不会接受多个表单提交具有相同ID的 ,例如在显示表单时在数据库表中插入 ID,并在提交表单时再次将其删除 。 还有很多其他解决方案。这些是我用过的那个 远。 (第一个是工作少,第二个是更安全)。 Jochen

That''s a very common problem in web applications. There''s different solutions: - have the "successfully sent" page redirect to another page (like back to where we came from), so the spammer would have to catch a 1-second time-window to hit F5. - include a uniqid() in a hidden field of the form, so the system won''t accept more than one form submission with the same ID, e.g. insert the ID in a db table when the form is being displayed and remove it again when the form is submitted. There''s prolly lotsa other solutions. These are the one''s I''ve used so far. (The first one is less work, the second one is more secure). Jochen

chris写道: 有没有一种方法可以在php或html中禁用后面和/或重新加载/刷新浏览器,这样潜在的垃圾邮件发送者就不能再保持刷新了页面发送确认电子邮件的表单 is there a way in either php or html to disable the back and or the reload/refresh on a browser so a potential spammer cant just keep refreshing the page of a form that sends a confirmation email out

在PHP中,查看参考页面,如果参考页面不是来自 $ b $的页面b链接到发送页面的地方,然后将它们重定向到另一个页面, 祝他们新年快乐。 // Aho

In PHP, check the reference page, if the reference page isn''t the page from where the link is to the send-page, then redirect them to another page that wishes them "happy new year". //Aho

JO Aho写道: 在PHP中,检查参考页面,如果参考页面不是从链接到发送页面的页面,那么将它们重定向到另一个<希望他们新年快乐的页面。 In PHP, check the reference page, if the reference page isn''t the page from where the link is to the send-page, then redirect them to another page that wishes them "happy new year".

不能工作......当按下F5时,浏览器会发送相同内容referer 信息和以前一样。 Jochen

Won''t work... When pressing "F5", the browser sends the same referer info as before. Jochen

更多推荐

阻止某人重新加载页面

本文发布于:2023-11-01 19:58:56,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1550265.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:加载   页面

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!