I got this message for my sign up page: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/golpos5/public_html/signup.php on line 592
Will someone please help me fix the error? I can't seem to find it.. Thanks!
Here is the code from that page:
<?
// Turn off all error reporting
//error_reporting(E_NONE);
// Report all errors except E_NOTICE
//error_reporting(E_ALL ^ E_NOTICE);
// Turn off all error reporting including parse errors So BE SURE to comment when testing so to display errors
ini_set("display_errors", "0");
$settings = array(
'dbName'=>'personalindeed',
'dbUser'=>'root',
'dbPass'=>''
);
require_once 'classes/access.class.php';
$user = new flexibleAccess();
//--------- Captcha Initializing Code ---------Begin
require_once('classes/recaptchalib.php');
$publickey = "6LdFEAgAAAAAANWquRH8Xeb9wrjRAKScUk8MNJjM";
$privatekey = "6LdFEAgAAAAAAPsykbspq3r8p1HKT-FkIC-TUCkm";
//--------- Captcha Initializing Code ---------Begin
$Signupstatus="";
if (!empty($_GET['activate'])){
//This is the actual activation. User got the email and clicked on the special link we gave him/her
$hash = $user->escape($_GET['activate']);
$res = $user->query("SELECT `{$user->tbFields['active']}` FROM `{$user->dbTable}` WHERE `activationHash` = '$hash' LIMIT 1",__LINE__);
if ( $rec = mysql_fetch_array($res) ){
if ( $rec[0] == 1 )
$Signupstatus = '<b>Your account is already activated</b>';
else{
//Activate the account:
if ($user->query("UPDATE `{$user->dbTable}` SET `{$user->tbFields['active']}` = 1 WHERE `activationHash` = '$hash' LIMIT 1", __LINE__))
$Signupstatus = '<b>Account activated. You may login now</b>';
else
$Signupstatus = '<b>Unexpected error. Please contact an administrator</b>';
}
}else{
$Signupstatus = '<b>User account does not exists</b>';
}
}
if (!empty($_POST['username'])){
//Register user:
$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 . ")");
$Signupstatus="The reCAPTCHA wasn't entered correctly. Please try it again. " ."(reCAPTCHA said: ". $resp->error . ") ";
} else {
//Get an activation hash and mail it to the user
$hash = $user->randomPass(100);
while( mysql_num_rows($user->query("SELECT * FROM `{$user->dbTable}` WHERE `activationHash` = '$hash' LIMIT 1"))==1)//We need a unique hash
$hash = $user->randomPass(100);
//Adding the user. The logic is simple. We need to provide an associative array, where keys are the field names and values are the values :)
//$d = date('d m y H:i:s'); //System Date
$d = gmdate("d m y H:i:s"); //GMT
$postdate = $d{6}.$d{7}.$d{3}.$d{4}.$d{0}.$d{1}.$d{9}.$d{10}.$d{12}.$d{13}.$d{15}.$d{16}; //convert the date to MySQL format
//Enable if calender popup is used instead of drop down menus
//$d2 = $_POST['birthdate'];
//$birthdate = $d2{6}.$d2{7}.$d2{8}.$d2{9}."-".$d2{0}.$d2{1}."-".$d2{3}.$d2{4}." 00:00:00"; //convert the date to MySQL format
$birthdate = $_POST['yeardropdown']."-".$_POST['monthdropdown']."-".$_POST['daydropdown']." 00:00:00";
$data = array(
'username' => $_POST['username'],
'email' => $_POST['email'],
'password' => $_POST['pwd'],
'activationHash' => $hash,
'active' => 0,
'firstname' => $_POST['firstname'],
'lastname' => $_POST['lastname'],
'birthdate' => $birthdate,
/*
'address' => $_POST['address'],
'address2' => $_POST['address2'],
'state' => $_POST['state'],
'city' => $_POST['city'],
'zipcode' => $_POST['zipcode'],
*/
'country' => $_POST['country'],
'postdate' => $postdate,
);
$userID = $user->insertUser($data);//The method returns the userID of the new user or 0 if the user is not added
if ($userID==0)
$Signupstatus=$Signupstatus.'<b>User not registered! Please choose a different username/email</b>';//user is allready registered or something like that
else {
$Signupstatus=$Signupstatus.'<b>User registered with user id '.$userID. '. Activate your account using the instructions on your welcome email.</b>';
include ("classes/manipulateDB.php");
$mdbclass = new manipulateDB();
//$cdb = $mdbclass->connect_db();
//We will upload the images and get $uploadedlink values before inserting data in DB
include('includes/upload_actions.php');
//Insert other user related info into the profiles table
$data = array(
'userid' => $userID,
'image1' => $uploadedlink1,
'leagueid' => $_POST['favoriteleague'],
'teamid' => $_POST['favoriteteam'],
'playerid' => $_POST['favoriteplayer'],
'twitter' => $_POST['twitter'],
);
$idb = $mdbclass->insertDB("profiles",$data);