某些浏览器缓存验证码,导致重新打开该页面时总提示验证码过期。 生成地址后面加个js随机参数,url?r=Math.random() 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <img id="checkcode" src="" /><input type="button" onclick="document.getElementById('checkcode').src='code.php?r=' + Math.random() " value="点击查看验证码" /> <img src="captcha.php?t=<?=time() ?>"> 你在验证码图片生成程序中加入禁止缓存的头header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the pastheader ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1header ("Pragma: no-cache"); // HTTP/1.0就可一劳永逸的解决这个问题,而不必每到使用时去改变url Math.random()已经有了,可是不行,现在代码是:<img src="/e/ShowKey/?v=login" name="KeyImg" id="KeyImg" align="absmiddle" onclick="KeyImg.src='/e/ShowKey/?v=login&rm='+Math.random()" title="看不清,换一张" width="70" height="30" alt="" /> <img src="/e/ShowKey/?v=login&rm='+Math.random()" name="KeyImg" id="KeyImg" align="absmiddle" onclick="KeyImg.src='/e/ShowKey/?v=login&rm='+Math.random()" title="看不清,换一张" width="70" height="30" alt="" />都加上了,也不行 有个调试错误看不太明白,希望高手解释下! base64_decode php的base64这个算法的加密与解密是怎么样的呢? smarty 的页面展示?头大了。。。 如果让PHPMyAdmin使用HTTP验证登录 PHP关联数组中的偏移量可以用变量吗? 怎么理解这个累计金额 如何实现内容与图片分离!!! iis + php 配置问题! 怎样实现在线视频???(很急的!!!) php zip 压缩 异常 请教二维数组矩阵算法 php递归导致内存不够
<input type="button" onclick="document.getElementById('checkcode').src='code.php?r=' + Math.random() " value="点击查看验证码" />
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header ("Pragma: no-cache"); // HTTP/1.0
就可一劳永逸的解决这个问题,而不必每到使用时去改变url
<img src="/e/ShowKey/?v=login" name="KeyImg" id="KeyImg" align="absmiddle" onclick="KeyImg.src='/e/ShowKey/?v=login&rm='+Math.random()" title="看不清,换一张" width="70" height="30" alt="" />
都加上了,也不行