简体   繁体   中英

Captcha code refresh problem

I've a quick contact form on every page of my site. For captcha code I'm using free php catcha code generation script in img tag. Quick contact form is a separate form which I included in other pages. I tried jQuery $.ajax() function to refresh the code. But it refreshes 2-3 times only then it stuck. I need to refresh the captcha code every time when form is submited. What could be the solution?

If I understand the problem correctly, you can add a random number as the parameter when calling the captcha script.

<img src="captcha.php?rnd=<?php echo md5(time() . uniqid()); ?>" alt="captcha" />

Just make sure it's random enough.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM