Jump to content

[SOLVED] T_FUNCTION error, really doing my head in, i dont know whats wrong.


jamesxg1

Recommended Posts

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.