Page 1 of 1

Image Captcha AJAX Refresh

Posted: Thu Jul 28, 2011 2:05 pm
by Pazuzu156
I'm using my own captcha image i created with PHP, and When a refresh button is pressed, I want it to cycle through the characters and create another captcha image. How would I so this using jQuery's AJAX and PHP to do this without refreshing the page?

Re: Image Captcha AJAX Refresh

Posted: Fri Jul 29, 2011 8:00 am
by phazorRise
You don't need Ajax to do this.
You can simply use-

Code: Select all

<img src="captcha_file.php?sid=<?php echo md5(time()) ?>" id="cap_img">
<a href="#"onclick="document.getElementById('cap_img').src = 'captcha_file.php?sid=' + Math.random(); return false">Refresh</a>
I use same thing on my site.

Re: Image Captcha AJAX Refresh

Posted: Fri Jul 29, 2011 10:29 pm
by Pazuzu156
I'll work with it some, thanks.