如何获取验证码图片的图片源来刷新验证码?
我正在尝试这样做,但它不起作用:
<img id="captcha_img" src="<?php echo CAPTCHA_PLUGIN_URL . "/captcha_images.php?width=120&height=40&code=$code?>"?>" />
Can't read the image? click <a href='javascript: refresh_captcha();'>here</a> to refresh
<script type="text/javascript">
var refr_no = 0;
function refresh_captcha()
{
var im = new Image();
refr_no = refr_no + 1;
im.src = "<?php echo CAPTCHA_PLUGIN_URL . "/captcha_images.php?width=120&height=40"?>&refresh=" + refr_no;
document.getElementById ("captcha_img").src = im.src;
}
</script>