Jump to content

How to force a browser to reload captcha image?


heavyEddie

Recommended Posts

 

I'm trying to force my captch to reload the image when a user clicks the image.  However, if you don't provide a unique URL some browsers will use a cached version of the image and not reload.  So, this is the code I'm trying to use, but it seems I'm doing something wrong.  Comes back with "now is not defined".

 

I'm pretty sure this is javascript 101 :)

 

echo '<img src="captcha.php?id=' . $id . '" onclick="javascript: this.src=\'captcha.php?id=' . $id . '&time=\' + now.getTime();" />';

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.