展开全部
数据库是32313133353236313431303231363533e4b893e5b19e31333231633166SQLserver
if(isset($_GET['username']))
{
session_start();
$errormsg = "";
$input['username'] = strtolower(trim($_GET['username']));
if($errormsg == "")
{
include("db_link.php");//你自己SQL数据库所在路径
$sql = "select
user_id,
username,
status
from guestbook
where username = '".$input['username']."' and status = 1";
$result = mysql_query($sql, $link) or die('Query database failed');
$num = mysql_num_rows($result);
if($num <1)
{
$errormsg &#61; "用户名不正确&#xff0c;请重新登录&#xff01;";
}
else
{
$row &#61; mysql_fetch_array($result);
if($row[&#39;username&#39;] &#61;&#61; $input[&#39;username&#39;])
{
$_SESSION[&#39;s_user_id&#39;] &#61; $row[&#39;user_id&#39;];
$_SESSION[&#39;s_username&#39;] &#61; $row[&#39;username&#39;];
$_SESSION[&#39;s_status&#39;] &#61; $row[&#39;status&#39;];
$_SESSION[&#39;time_last_load&#39;] &#61; time();
?>
管理员登录
button,input{font-size:12px;padding-top:2px;font-family : Arial, Helvetica, sans-serif;}
a:link:{color:#666666;}
a:visited:{color:#666666;}
a:hover:{color:#000000}
}
else
{
$errormsg &#61; "用户名不正确&#xff0c;请重新登录&#xff01;";
}
}
}
if($errormsg <> "")
{
?>
管理员登录
button,input{font-size:12px;padding-top:2px;}
|
用户名&#xff1a; | |
| |
|
&#61;$errormsg?> |
}
}
else
{
?>
管理员登录
button,input{
font-size:12px;
padding-top:2px;
}
}
?>
已赞过
已踩过<
你对这个回答的评价是&#xff1f;
评论
收起