我已经编写了登录代码,但我需要知道,作为成功消息,它会回显用户的名字。
名字存储在数据库中与电子邮件相同的条目中。
我需要制作一个数组,但我不知道如何。
if ($_POST['submit']) {
if ($_POST['email']) {
if ($_POST['password']) {
$password = md5($_POST['password']);
$email = $_POST['email'];
$p = mysql_query("SELECT * FROM Users WHERE Email='$email' AND Password='$password'");
if (mysql_fetch_array($p) != 0){
echo "WHAT GOES HERE?";
$registered = mysql_query("SELECT * FROM Users WHERE Email='$email'");
setcookie("PeopleHubLogged", ".$email.");
} else {
echo "<font color='red'>Login Failed</font>";
}
} else {
echo "<font color='red'>You need to enter a password!</font>";
}
} else {
echo "<font color='red'>You need to enter a email!</font>";
}
}