hai guys
i have generated a captcha image
and i want the image to change every time the user reaches the page..........
the code seem to work well with IE but in firefox the image does not get changed
.......i tried "onload" command but the image goes on for an infinite refresh............

pls lemme know if there is any solution.............

10 Years
Discussion Span
Last Post by ashercharles

If you are using a server-side language then manipulate the header to send

Cache-Control: no-cache
Pragma: no-cache

This tells the browser to get a fresh copy


sorry guys i forgot to paste the code.............
but here it is

function captcha_refresh() {
dv=new Date();
document.myform.captcha.value = "";
e.src="/captchamg.php?dummy=" + dv.getTime();
return false;


this come unesr the script validate.js.....

ive called it using in the a php code using

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" src="validate.js">

Edited by happygeek: fixed formatting


if u do that using mouse move event.

on document mouse move event start a timer, if timer is running for 10 or 20 second i.e. page is idle for that much second then call another function which will change the image.
i hope this will help.


hai all i want is to stop the image alone from being cached...i dont want the text to be disturbed...........

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.