jamesxg1 Posted September 25, 2009 Share Posted September 25, 2009 Hiya peeps, <?php session_start(); class Login { private $username; private $password; private $salt = "pepper89378"; function LoginSecure($username, $password, $salt) { $this->salt = sha1(md5($salt)); $this->password = mysql_real_escape_string(trim(addslashes(strip_tags(sha1(md5($password . $this->salt)))))); $this->username = mysql_real_escape_string(trim(addslashes(strip_tags(base64_encode($username))))); $this->usernamecheck = "SELECT `username` FROM `members` WHERE username = '$this->username'"; $this->runusernamecheck = mysql_query($this->usernamecheck) or trigger_error('Query failed: ' . mysql_error(), E_USER_ERROR); if(mysql_num_rows($this->runusernamecheck) == 1) { $this->passwordcheck = "SELECT `password` FROM `members` WHERE username = '$this->username' AND password = '$this->password'"; $this->runpasswordcheck = mysql_query($this->passwordcheck) or trigger_error('Query failed: ' . mysql_error(), E_USER_ERROR); if(mysql_num_rows($this->runpasswordcheck) == 1) { $this->details = "SELECT * FROM `members` WHERE username = '$this->username' AND password = '$this->password'"; $this->rundetails = mysql_query($this->details) or trigger_error('Query failed: ' . mysql_error(), E_USER_ERROR); while($details = mysql_fecth_array($this->rundetails)) { $this->username = base64_decode($details['username']); $this->user_id = is_numeric($details['user_id']); if($details['ad'] == 1) { header('Location: suspended.php?username=' . $this->username); } else { if($details['ad'] == 2) { $_SESSION['user_id'] = $this->user_id; $_SESSION['username'] = $this->username; $this->time = date('h:i'); $this->timeA = date('A'); $this->date = date("m-d-Y"); $this->ip = $_SERVER["REMOTE_ADDR"]; $this->browser = $_SERVER['HTTP_USER_AGENT']; $this->insert = "INSERT INTO `memberlogs` (`username`, `user_id`, `time`, `timea`, `date`, `ip`, `browser`) VALUES('$this->username', '$this->user_id', '$this->time', '$this->timeA', '$this->date', '$this->ip', '$this->browser')"; $this->runinsert = mysql_query($this->insert) or trigger_error('Query failed: ' . mysql_error(), E_USER_ERROR); if($details['lf'] == 1) { header('Location: controlpanel.php?first=1'); } else { header('Location: controlpanel.php'); } } } } } else { $this->wrongusername = "Wrong username, Please try again."; return($this->wrongusername); } } else { $this->wrongpassword = "Wrong password, Please try again."; return($this->wrongpassword); } } ?> Parse error: syntax error, unexpected ';', expecting T_FUNCTION in C:\Program Files\xampp\xampp\htdocs\socialbuild\library\Login.inc.php on line 93 Line 93: Is the last *}* on the page. Many thanks, James. Link to comment https://forums.phpfreaks.com/topic/175537-solved-t_function-error-really-doing-my-head-in-i-dont-know-whats-wrong/ Share on other sites More sharing options...
Maq Posted September 25, 2009 Share Posted September 25, 2009 You're missing a terminating '}'. You have 12 opening and only 11 closing. Link to comment https://forums.phpfreaks.com/topic/175537-solved-t_function-error-really-doing-my-head-in-i-dont-know-whats-wrong/#findComment-924985 Share on other sites More sharing options...
jamesxg1 Posted September 25, 2009 Author Share Posted September 25, 2009 Cheers mate. Many thanks, James. Link to comment https://forums.phpfreaks.com/topic/175537-solved-t_function-error-really-doing-my-head-in-i-dont-know-whats-wrong/#findComment-924987 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.