execute javascript before return in php
Posted
by user354051
on Stack Overflow
See other posts from Stack Overflow
or by user354051
Published on 2010-06-10T08:21:40Z
Indexed on
2010/06/10
8:52 UTC
Read the original article
Hit count: 236
I do have a custom php script that validates captcha code and sends an email. If php script is sending a mail successfully then it returns "true". This is done by:
if(!$Error){
echo "true";
exit;
}
Before returning true, I would like to execute a jQuery command that should refresh the captcha image. I shouldn't be doing this is client side as it might be risky from spammers point of view.
To refresh the captcha image, The command is:
jQuery('#captcha').attr('src', ('php/captcha/captchaimage_show.php?' + Math.random()));
I need to call this command from within php scripts before return any results by "echo"
Prashant
© Stack Overflow or respective owner