Remember Username & Password
Posted: Sat Mar 15, 2008 2:02 pm
At present I'm using $_SESSION['UserName'] to create and store the login details. But I'm not able to access this session variable. Is there any way for the website to remember these details?
I'm using <?php echo $_session['loginname']; in index.php. Is there anything wrong with the code?
Code: Select all
$count=mysql_num_rows($result);
// If result matched $myusername and $mypassword, table row must be 1 row
if($count==1){
// Register $myusername, $mypassword and redirect to file "LoginOK.php"
session_start();
session_register("myusername");
session_register("mypassword");
$_SESSION['loginname'] = $myusername;
//echo $_session['loginname'];
header("location:index.php");
}