Hello
I read sessions and php but it's not exactly registering in my head that I understand it easily. On my site someone signups all is good they get their email and register sign in.
I have them signup with a Desired Username, Email address and Password okay. Now when they come back to sign in all that is required is their Email address and Password and I want them to be greeted once in by their desired username.
It is doing it but only keeping the first desired username, it doesn't register the new user it only keeps listing the 1st persons username. If you know what I should do I'd be really grateful! This is what I have
<?
include 'db.php';
// get the variables from home page
$password = $_REQUEST;
$email_address = $_REQUEST;
$sql_check = mysql_query("UPDATE members WHERE password='$password' AND
email_address='$email_address'");
$sql_check = mysql_query("SELECT * FROM members WHERE
password='$password' AND
email_address='$email_address'");
$SQL="SELECT * FROM members";
$RESULT=mysql_query($SQL);
//Get the result:
$username=mysql_fetch_array($RESULT);
$sql_check_num = mysql_num_rows($sql_check);
if($sql_check_num == 0){
//Display it:
echo ("<STRONG>You must be a member!</STRONG>");
} else {
echo ("Welcome")," ", $username["username"];
}
?>