USB
07-31-2012, 10:18 PM
hi, I wonder if $this is a already created variable in PHP and what " -> " is and when you use it.
I see that its used alot in this code.
function Login()
{
if(empty($_POST['username']))
{
$this->HandleError("UserName is empty!");
return false;
}
if(empty($_POST['password']))
{
$this->HandleError("Password is empty!");
return false;
}
$username = trim($_POST['username']);
$password = trim($_POST['password']);
if(!$this->CheckLoginInDB($username,$password))
{
return false;
}
session_start();
$_SESSION[$this->GetLoginSessionVar()] = $username;
return true;
}
I see that its used alot in this code.
function Login()
{
if(empty($_POST['username']))
{
$this->HandleError("UserName is empty!");
return false;
}
if(empty($_POST['password']))
{
$this->HandleError("Password is empty!");
return false;
}
$username = trim($_POST['username']);
$password = trim($_POST['password']);
if(!$this->CheckLoginInDB($username,$password))
{
return false;
}
session_start();
$_SESSION[$this->GetLoginSessionVar()] = $username;
return true;
}