heavyEddie Posted June 3, 2007 Share Posted June 3, 2007 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();" />'; Quote Link to comment Share on other sites More sharing options...
heavyEddie Posted June 3, 2007 Author Share Posted June 3, 2007 Never mind, this seems to work well... echo '<img src="captcha.php?id=' . $id . '" onclick="javascript: this.src=\'captcha.php?id=' . $id . '&time=\' + (new Date()).getTime();" />'; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.