Parse error: syntax error, unexpected T_STRING
このコードは行で解析エラーを出している$gender=$user['gender'];
.....このコードの何が問題なのか...助けが必要.....ありがとう
<?php
require_once 'config/functions.php';
session_start();
$user=$_SESSION['google_data'];
if(!empty($user)){
$email = $user['email'];
$fname = $user['given_name'];
$lname = $user['family_name'];
$gender=$user['gender'];
$dob = $user['birthday'];
$location = '';
$picture = $user['picture'];
$uid = $user['id'];
$ousername = '';
$link = $user['link'];
$provider = 'google';
$verified = $user['verified_email'];
$gen=0;
if($gender == 'male'){$gen=1;} else{$gen=0;}
$new_dob = date( "Y-m-d H:i:s", strtotime($dob) );
$userObj = new User();
$userdata = $userObj->checkUser($email,$fname,$lname,$gen,$new_dob,$location,$picture,$uid,$ousername,$link,$provider,$new_verified);
if(!empty($userdata)){
$_SESSION['id'] = $userdata['user_id'];
$_SESSION['oauth_id'] = $userdata['user_oauth_id'];
$_SESSION['username'] = $userdata['user_oauth_username'];
$_SESSION['picture'] = $userdata['picture'];
$_SESSION['link'] = $userdata['link'];
$_SESSION['fname'] = $userdata['user_fname'];
$_SESSION['lname'] = $userdata['user_lname'];
$_SESSION['gender'] = $userdata['user_gender'];
$_SESSION['email'] = $userdata['user_email'];
$_SESSION['oauth_provider'] = $userdata['user_oauth_provider'];
$_SESSION['oauth_id'] = $uid;
} else {
# For testing purposes, if there was an error, let's kill the script
die("There was an error.");
}
}
?>