Hi guys,
Wish you all a merry xmas !!
Just a quickie here, I am attempting to pull off some data from a database, but I am unsure how to set the variable with the contents of the field in my db, its a login script, I am attempting to pull off the email of a user where their name and password = to whatever they put in the login form... theres a bitta psuedo-code for ya, anyways heres the real code ...
$sql = "SELECT Email FROM " . $Table . " WHERE Name='" . addslashes($_POST['Name']) . "' AND Password='" . md5($_POST['Password']) . "' LIMIT 1";
if(!($result = mysql_query($sql))) die(mysql_error());
if(mysql_num_rows($result) == 1) {
setcookie("LoggedIn", TRUE, time()+(3600 * 24));
echo "$Email Continue to the <a href=members.php>Members</a> page.";
} else {
echo "Login failure";
}
At the moment the email variable is undefined when I try it through my browser, hence why I need to set it but am unsure exactly how, can anyone provide me with an example based on the above code?
Cheers in advance!