Sunday, 13 May 2018

php - Parse error: syntax error, unexpected end of file (Registration script)




I have a problem with my script :S




This is the error:Parse error: syntax error, unexpected end of file





Here is the full code.I searched for not closed bracklets or something but didn't found any :S
I hope some of you guys can find the problem.



include "header.php";
include "menu.php";
?>










if(isset($_POST['register']))
{

if($captcha['captcha'] == 'enabled')
{
require_once('recaptchalib.php');
$privatekey = $captcha['captchaprivate'];
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);

if (!$resp->is_valid) {

die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." . "(reCAPTCHA said: " . $resp->error . ")");
}
else
{
registerUser($_POST['username'], $_POST['password'], $_POST['passwordagain'], $_POST['email'], $_POST['mcname']);
}
}
include "footer.php";
?>


Answer



you forgot the closing bracket on this statement:



if (!$resp->is_valid) {
die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." . "(reCAPTCHA said: " . $resp->error . ")");
}

No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...