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?
[PHP]$count=mysql_nu m_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.ph p"
session_start() ;
session_registe r("myusername") ;
session_registe r("mypassword") ;
$_SESSION['loginname'] = $myusername;
//echo $_session['loginname'];
header("locatio n:index.php");
}[/PHP]
I'm using <?php echo $_session['loginname']; in index.php. Is there anything wrong with the code?
[PHP]$count=mysql_nu m_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.ph p"
session_start() ;
session_registe r("myusername") ;
session_registe r("mypassword") ;
$_SESSION['loginname'] = $myusername;
//echo $_session['loginname'];
header("locatio n:index.php");
}[/PHP]
I'm using <?php echo $_session['loginname']; in index.php. Is there anything wrong with the code?
Comment