Jump to content

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


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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.