i'm just very new in php & its my 1st post here.. having a small problem to pass the login error msg to LOGIN.PHP from check login page.
here is the code of checklogin.php file:
if($count==1){
// Register $myusername, $mypassword and redirect to file "welcome.php"
session_register("myusername");
session_register("mypassword");
header("location:welcome.php");
}
else {
$msg = urlencode("Invalid Login. Please try again with correct user email and password. ");
header("Location: login.php?msg=$msg");
}
And here is the login.php file where want to show the error mssg:
<?php
if (isset($GET['msg'])) {
$err = mysql_real_escape_string($_GET['msg']);
echo $err;
}
?>
Anybody help please where to change or add the code ?