-1

I need some help, i'm implementing the google recaptcha into a php site, but after finishing the code and uploading it this error is shown:

Parse error: syntax error, unexpected end of file in /home/cbj/public_html/2016/solicitudForm.php on line 29

now, here is my code for the recaptcha

<?php
    $memberType;$name;$email;$phone;$address;$captcha;
    if(isset($_POST['memberType'])){
      $memberType=$_POST['memberType'];
    }
    if(isset($_POST['name'])){
      $name=$_POST['name'];
    }
    if(isset($_POST['email'])){
      $email=$_POST['email'];
    }
    if(isset($_POST['phone'])){
      $phone=$_POST['phone'];
    }
    if(isset($_POST['address'])){
      $address=$_POST['address'];
    }
    if(isset($_POST['g-recaptcha-response'])){
      $captcha=$_POST['g-recaptcha-response'];
    }
    if(!$captcha){
      echo '<div class="alert alert-warning">
              Por favor, verifica que seas humano
            </div>';
      exit;
    }
    $secretKey = "6LeEECoTAAAAAGLUBgHQ_OC-ZYJi0Sj2b_1JPRUx";
    $response=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secretKey."&response=".$captcha);
    $responseKeys = json_decode($response,true);
    if(intval($responseKeys["success"]) !== 1) {
      echo '<h2>You are spammer ! Get the @$%K out</h2>';
    } else {
      echo '<h2>Thanks for posting comment.</h2>';
    } 
?>

Any help could be appreciated, thanks.

1 Answers1

-1

for some reason the last semi colon was not detected (and not even saved) on local PC, writing the code directly in server makes work.