This is when login is validated and before moving to secured page.
$_SESSION['user']=$user;
This is from the secured page.
$user = $_SESSION['user']; $username = $user->username;
This is the class page
class sessionUserInfo {
public $username;
public $time;
public $name;
public $email;
public function setUsername($x){
$this->username = $x;
}
public function setTime($x){
$this->time = $x;
}
public function setName($x){
$this->name = $x;
}
public function setEmail($x){
$this->email = $x;
}
}
There is also a function that creates the session.
public function createUserSession($x){
$getUser = mysql_query("
SELECT *
FROM supply_users
WHERE supply_users.supply_user_username = '$x'
") or die(mysql_error());
while($row=mysql_fetch_assoc($getUser)){
$name = $row['supply_user_name'];
$email = $row['supply_user_email'];
$username = $row['supply_user_username'];
}
$time = date("D, d M Y H:i:s");
$userSession = new sessionUserInfo;
$userSession->setUsername($username);
$userSession->setTime($time);
$userSession->setName($name);
$userSession->setEmail($email);
return $userSession;
}
Other than these snippets theres not much else on the three files that should affect the script.
This post has been edited by gilsal: 24 May 2011 - 05:28 AM

New Topic/Question
Reply




MultiQuote





|