case 'login': global $db; $email = isset($_POST['email']) ? $_POST['email'] : ""; $password = isset($_POST['password']) ? $_POST['password'] : ""; if (!empty($email) && !empty($password)) { $sql = "select * from `user` where email='$email' and password='$password'"; $row = mysql_fetch_array(mysql_query($db, $sql)); if ($row) { echo "<script language=javascript>alert('登陆成功!');history.back();</script>"; header('Location:index.php'); } else { echo "<script language=javascript>alert('用户名或密码错误!');history.back();</script>"; } } else{ echo "<script language=javascript>alert('不能为空!');history.back();</script>"; } break;
啊 真的对了 为什么呀