I can view the username, but the password cannot be displayed on the page.
This is a login form and I want to be able to display the password on one of the interior restricted pages. however it doesn't seem to be registering the variable. The username can be displayed but not the password, why?
Code:
<?php
// *** Validate request to login to this site.
session_start();
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($accesscheck)) {
$GLOBALS['PrevUrl'] = $accesscheck;
session_register('PrevUrl');
}
if (isset($_POST['username'])) {
$loginUsername=$_POST['username'];
$password=$_POST['password'];
$MM_fldUserAuthorization = "usergroup";
$MM_redirectLoginSuccess = "admin_menu.php";
$MM_redirectLoginFailed = "login.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_voip, $voip);
$LoginRS__query=sprintf("SELECT franchisee_name, franchisee_code, usergroup FROM franchisee WHERE franchisee_name='%s' AND franchisee_code='%s'",
get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password));
$LoginRS = mysql_query($LoginRS__query, $voip) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = mysql_result($LoginRS,0,'usergroup');
$GLOBALS['MM_Username'] = $loginUsername;
$GLOBALS['MM_Password'] = $password;
$GLOBALS['MM_UserGroup'] = $loginStrGroup;
//register the session variables
session_register("MM_Username");
session_register("MM_Password");
session_register("MM_UserGroup");
if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>
<?php echo $_SESSION['MM_Password']; ?>