Recaptcha Bug Loop <p>I started to work on recaptcha file but this one keeps looping (don't know why). </p> <pre><code> &lt;?php if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser header('Location: ../'); exit; } class qa_recaptcha_captcha { var $directory; function load_module($directory, $urltoroot) { $this-&gt;directory=$directory; } function admin_form() { $saved=false; if (qa_clicked('recaptcha_save_button')) { qa_opt('recaptcha_public_key', qa_post_text('recaptcha_public_key_field')); qa_opt('recaptcha_private_key', qa_post_text('recaptcha_private_key_field')); $saved=true; } $form=array( 'ok' =&gt; $saved ? 'reCAPTCHA settings saved' : null, 'fields' =&gt; array( 'public' =&gt; array( 'label' =&gt; 'reCAPTCHA public key:', 'value' =&gt; qa_opt('recaptcha_public_key'), 'tags' =&gt; 'name="recaptcha_public_key_field"', ), 'private' =&gt; array( 'label' =&gt; 'reCAPTCHA private key:', 'value' =&gt; qa_opt('recaptcha_private_key'), 'tags' =&gt; 'name="recaptcha_private_key_field"', 'error' =&gt; $this-&gt;recaptcha_error_html(), ), ), 'buttons' =&gt; array( array( 'label' =&gt; 'Save Changes', 'tags' =&gt; 'name="recaptcha_save_button"', ), ), ); return $form; } function recaptcha_error_html() { if (!function_exists('fsockopen')) return 'To use reCAPTCHA, the fsockopen() PHP function must be enabled on your server. Please check with your system administrator.'; elseif ( (!strlen(trim(qa_opt('recaptcha_public_key')))) || (!strlen(trim(qa_opt('recaptcha_private_key')))) ) { require_once $this-&gt;directory.'recaptchalib.php'; $url=recaptcha_get_signup_url(@$_SERVER['HTTP_HOST'], qa_opt('site_title')); return 'To use reCAPTCHA, you must &lt;a href="'.qa_html($url).'"&gt;sign up&lt;/a&gt; to get these keys.'; } return null; } function allow_captcha() { return function_exists('fsockopen') &amp;&amp; strlen(trim(qa_opt('recaptcha_public_key'))) &amp;&amp; strlen(trim(qa_opt('recaptcha_private_key'))); } function form_html(&amp;$qa_content, $error) { require_once $this-&gt;directory.'recaptchalib.php'; $language=qa_opt('site_language'); if (strpos('|en|nl|fr|de|pt|ru|es|tr|', '|'.$language.'|')===false) // supported as of 3/2010 $language='en'; $qa_content['script_lines'][]=array( "var RecaptchaOptions={", "\ttheme:'white',", "\tlang:".qa_js($language), "};", ); return recaptcha_get_html(qa_opt('recaptcha_public_key'), $error, qa_is_https_probably()); } function validate_post(&amp;$error) { if ( (!empty($_POST['recaptcha_challenge_field'])) &amp;&amp; (!empty($_POST['recaptcha_response_field'])) ) { require_once $this-&gt;directory.'recaptchalib.php'; $answer=recaptcha_check_answer( qa_opt('recaptcha_private_key'), qa_remote_ip_address(), $_POST['recaptcha_challenge_field'], $_POST['recaptcha_response_field'] ); if ($answer-&gt;is_valid) return true; $error=@$answer-&gt;error; } return false; } } </code></pre> <p>I am getting Internal Server Error because of that. What might be the issue? Please help me. Im sitting on this third day and I thought maybe I am missing something obvious.</p>