php - Recaptcha check page returns nothing -


i have feedback webpage on php-based project. feedback page has form fields need , put recaptcha display there , works fine: displayed , functions according google manuals. form "action" set page should check recaptcha, prevent sql injections , insert user message db. seems simple.

the problem in second page. returns blank though shouldnt:

<?php   require_once('recaptchalib.php');   $privatekey = "my private key";   $resp = recaptcha_check_answer ($privatekey,                                 $_server["remote_addr"],                                 $_post["recaptcha_challenge_field"],                                 $_post["recaptcha_response_field"]);    if (!$resp->is_valid) {     // happens when captcha entered incorrectly      //in case returned page totally blank      echo <<<eot <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>error</title> </head> <body bgcolor="whitesmoke">  eot;      switch ($_post["lang"]) {     case "en":         echo <<<eot  <table width="100%" height="100%" border="0" cellspacing="10" align="center">   <tr>     <td width="100" height="100" align="center" valign="middle"><h3>captcha failed ($resp->error)!</h3></td>   </tr>   </table>   <meta http-equiv='refresh' content='3; url=feedback_en.php'> </body> </html> eot;         break;     //here go other possible $_post['lang'] values removed sample since irrelevant }   } else {     // code here handle successful verification     //in case page returns totally blank either      //here goes db stuff      //here goes sql injection check skipped code      //more db stuff          switch ($_post["lang"]) {     case "en":         echo <<<eot <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>thank you!</title> <meta http-equiv='refresh' content='3; url=feedback_en.php'> </head>  <body bgcolor="whitesmoke"> <table width="100%" height="100%" border="0" cellspacing="10" align="center">   <tr>     <td width="100" height="100" align="center" valign="middle"><h3>thank feedback, service better!</h3></td>   </tr>   </table> </body> </html> eot;         break;     //and on... } //end of switch     //and have nothing   }   ?> 

as noted in code, whatever result of test, output page blank. works decent if leave recaptcha field empty. returns html according idea text "captcha failed (incorrect-captcha-sol)!"


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -