Ricevo questo errore da quando ho inserito i codici per il controllo recaptcha di Google e non riesco a capire il motivo.
Qui sotto la pagina da cui ricevo l'errore e la riga 67 � l'ultima (qui � diversa perch� ho tolto alcuni commenti), quella che chiude il codice PHP: ?>
Codice PHP:
<?php
$error = 0;
$success = 0;
//verify captcha
if (isset($_POST['register']) && $_POST['g-recaptcha-response']!="")
{
$secret = 'YOUR-SECRET-CODE';
$verifyResponse = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret='.$secret.'&response='.$_POST['g-recaptcha-response']);
$responseData = json_decode($verifyResponse);
if($responseData->success)
{
$lastname = $_POST["last_name"];
$name = $_POST["name"];
$phone = $_POST["phone"];
$address = $_POST["address"];
$postcode = $_POST["postcode"];
$dob = $_POST["dob"];
$email = $_POST["email"];
$password = $_POST["password"];
$cpassword = $_POST["cpassword"];
if (!empty($lastname) && !empty($name) && !empty($dob) && !empty($email) && !empty($password) && !empty($cpassword)){
$encrypted = md5($password);
date_default_timezone_set('Europe/Rome');
$dob_post = $dob;
$dob = explode("-",$dob);
$curMonth = date("m");
$curDay = date("j");
$curYear = date("Y");
$age = $curYear - $dob[0];
if($curMonth<$dob[1] || ($curMonth==$dob[1] && $curDay<$dob[2]))
$age--;
if ($age < 18)
$role = "Student";
else
$role = "Senior";
$query = "INSERT INTO user(USER_LASTNAME, USER_FIRTSNAME, USER_PHONE,USER_ADDRESS,USER_POSTCODE,
USER_DOB,USER_EMAIL,USER_PASSWORD,USER_ROLE) VALUES ('$lastname','$name','$phone','$address','$postcode',
'$dob_post','$email','$encrypted','$role')";
$result = mysqli_query ($connection,$query)
or die ("You couldn't insert the data into the DDBB.");
$success = 1;
}
else{
$error = 1;
}
}
?>
prima della modifica il file (funzionante) era cos�
Codice PHP:
<?php
$error = 0;
$success = 0;
if (isset($_POST['register'])) {
$lastname = $_POST["last_name"];
...
..
Qualcuno pu� verificarne il motivo?