是否有一种方法可以在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
更多推荐
阻止某人重新加载页面
发布评论