Perl 验证码在 Windows 7 上不刷新
我创建了一个如下所示的验证码:
<img src="/cgi-bin/rand.pl" />
问题是,如果有人导航离开或返回带有验证码的页面,它不会刷新,这会使验证码无效(特别是如果他们之前已经提交过表单) )是否有强制刷新的方法,因为我怀疑使用 javascript 设置图像源也不会强制刷新。图像真正刷新的唯一时间是使用浏览器上的刷新按钮。 (这在 IE8/7、Windows XP 上的 Mozilla 中不是问题;我只是在 Windows 7 上注意到它)
I have created a captcha which looks like this:
<img src="/cgi-bin/rand.pl" />
The problem is that if someone navigates away from or back to the page with the captcha on it, it doesn't refresh which makes the captcha invalid (especially if they have already submitted the form before) Is there anyway to force a refresh as I suspect setting the image source with javascript wouldn't force a refresh either. The only time the image actually is refreshing is if the refresh button on the browser is used. (this isn't a problem in IE8/7,mozilla on windows XP; I just noticed it on windows 7)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用当前或过去的 HTTP 日期时间设置
Expires
标头标记以表明该资源不得被缓存。使用CGI
模块的示例:要自行创建符合标准的日期时间戳,请使用
HTTP::Date
或DateTime::Format::HTTP.
Set the
Expires
header with the current or a past HTTP datetime stamp to signal that the resource must not be cached. Example using theCGI
module:To create a standard-conforming datetime stamp on your own, use
HTTP::Date
orDateTime::Format::HTTP
.