Hi guys,
i'm using Sajax call phpmailer, and return error 200 alert popup. I have looked through the forum for a fix for this but I was unable to find one.
trivia.php
it always returning popup alert error 200, but the sendmail() function works well...Code:<?PHP require_once("inc/sajax.php"); include ('inc/connection.php'); require_once('phpmailer/class.phpmailer.php'); $ans="ans"; $email="email1"; function point_trivia($ans){ sendmail($email); return 1; } sajax_export("point_trivia"); sajax_handle_client_request(); ?> <html> <head> <script type="text/javascript" src="js/sajax.js"></script> <script type="text/javascript"> <?php sajax_show_javascript(); ?> function action_success(result){ //alert(result); if (result=='1') { } else if (result != '0') { alert (result); } } function answer(){ var jawab=getCheckedValue(document.forms['radioExampleForm'].elements['myInput']); var test="<?PHP echo $ans; ?>"; if (answer == test){ alert("nice answer"); //x_point_trivia(jawab,action_success); }else{ alert("wrong password"); } } function getCheckedValue(radioObj) { if(!radioObj) return ""; var radioLength = radioObj.length; if(radioLength == undefined) if(radioObj.checked) return radioObj.value; else return ""; for(var i = 0; i < radioLength; i++) { if(radioObj[i].checked) { return radioObj[i].value; } } return ""; } </script> </head> <body> <form name="radioExampleForm" method="get" action="" onsubmit="return false;"> <input id="test1" name="myInput" type="radio" value="ans"><br> <input id="test2" name="myInput" type="radio" value="ans1"><br> <input id="test3" name="myInput" type="radio" value="ans2"><br> <br> <input name="mybutton" type="button" onclick="answer()" value="ok> </form> </body> </html
I'm sorry again I really need to solve this and i tried to google but I can't find the solution.
Thank you so much


Reply With Quote
Bookmarks