0

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.............

4
Contributors
6
Replies
7
Views
9 Years
Discussion Span
Last Post by ashercharles
0

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

0

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

function captcha_refresh() {
e=document.getElementById('captcha');
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

0

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.

0

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.