views:

51

answers:

2

So I have this form here: http://www.piataterenuri.info/register.php The problem is that Firefox caches the captcha image and after an incorect input, or a page refresh the captcha will show the old image instead of the curent one.

I've already placed:

header("Cache-Control: no-cache");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");

And also changed the captcha img src to

<?php $rand=microtime() * mktime(); echo "src=\"captcha.php?time=$rand\""; ?>

What else can I do to stop firefox from caching the image?

A: 

force ffx to load the image after page was loaded via ajax

ITroubs
I don't know ajax, isn't there an easier method?...
Cristy
+2  A: 

Fix this Last-Modified: Tue, 12 Oct 2010 18:11:57 GMT. Send the current time in the Last-Modified header.

Alin Purcaru
Thanks a lot, that worked :D PS: Tu dadusei add pe mess?:))
Cristy
No problem. @PS: Nu eu.
Alin Purcaru