require_once '../include/common.inc.php'; require_once '../include/user.class.php'; session_start(); $action = $_POST["action"]; if ($action == "save") { $username = $_POST["username"]; $userpass = $_POST["password"]; if (function_exists("imagejpeg")) { if (empty($_SESSION['captcha']) || trim(strtolower($_POST['capcode'])) != $_SESSION['captcha']) { ShowMsg("验证码错误,请重新输入"); exit; } } $userdata = new User(); $existuser = $userdata->ExistUserPassword($username, $userpass); if ($existuser == 1) { $userinfo = $userdata->GetUserByName($username); session_start(); $_SESSION["adminid"] = $userinfo->uid; header("location:index.php"); } else { ShowMsg("用户名或密码错误"); exit; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>