34 lines
801 B
PHP
34 lines
801 B
PHP
<?php
|
|
session_start();
|
|
include_once("../../inc/class.php");
|
|
$db = new myConn;
|
|
$GG=array_merge($db->getpost($_POST,"uname|user|3|16|1"),$GG);
|
|
$upwd=md5($_POST[upwd]);//MD5加密
|
|
if($GG['uname'] && $upwd){
|
|
$db->links();
|
|
$row = $db->getdy("*",TABLE."adm","username='$GG[uname]' and userpass='$upwd'");
|
|
if($row){
|
|
$save=array(
|
|
'timeone'=>time(),
|
|
'timetwo'=>$row['timeone'],
|
|
'timethree'=>$row['timetwo'],
|
|
'ipone'=>$db->getip(),
|
|
'iptwo'=>$row['ipone'],
|
|
'ipthree'=>$row['iptwo']
|
|
);
|
|
//修改数据库
|
|
$db->update(TABLE."adm",$save,"id='$row[id]'",1);
|
|
//写入登录信息及SESSION
|
|
$_SESSION['XQAdUser']=$row['username'];
|
|
$_SESSION['XQAdPower']=$row['power'];
|
|
$_SESSION['XQAdid']=$row['id'];
|
|
echo "/admin";
|
|
}else{
|
|
echo "no";
|
|
}
|
|
$db->close();
|
|
}else{
|
|
echo "no";
|
|
}
|
|
unset($GG,$db);
|
|
?>
|