View Single Post
  #2 (permalink)  
Old 06-28-03, 06:54 AM
ChristGuy ChristGuy is offline
Operations Support Develo
 
Join Date: Jun 2003
Location: Rivonia, South Africa
Posts: 111
Thanks: 0
Thanked 0 Times in 0 Posts
I'd say using sessions...

Basically...

at the top of protected pages:
PHP Code:

<?php

  
if (!isset($_SESSION["username"]))
  {
    
Header('Location: login.php');
  }
?>
To register the variables:
PHP Code:

<?php

  
// If the user is valid
  
if (IsValidUser($Username))
  {
    
$_SESSION["username"] = $Username;
  }
  else
  {
    echo 
"Invalid user"
  
}
?>
To logout
PHP Code:

<?php

  $_SESSION 
= array();
  
Session_destoy();
?>
Hope that helps...
__________________
Till We Meet Again...
Clifford W. Hansen
Aspivia (Pty) Ltd

"We Have Seen Strange Things Today!" Luke 5:26
Reply With Quote