我对编码不太熟悉,因为我是这个世界的新手并且正在苦苦挣扎,所以请让我知道会话如何解决和工作。我的这段代码虽然没有给出任何错误,但显示的是空白页而不是结果。请帮忙!
<?
session_start();
include_once("config.php");
if($_SESSION['email']){
header('location:home.php');
}elseif(!isset($_SESSION['email'])){
if(isset($_POST['email']) && isset($_POST['pwd'])){
}
$email=mysql_real_escape_string($_POST['email']);
$pwd=mysql_real_escape_string($_POST['pwd']);
$password=md5($pwd);
$query="select * from users where email='".$email."'";// and password='".$password."'";
$exec=mysql_query($query);
$count=mysql_num_rows($exec);
// echo $count; exit;
if($count==1){
while($result=(mysql_fetch_array($exec))){
$fname=ucfirst($result[1]);
$lname=ucfirst($result[2]);
$_SESSION['fname']=$result[1];
$_SESSION['lname']=$result[2];
echo "Welcome ". $_SESSION['fname']. " " .$_SESSION['lname'];
}
}elseif ($count > 1){
}elseif ($count < 1){
$error="Sorry! Your account is not registered.";
header('Location: index.php?err="'.$error.'"');
}
}
?>