工会web
This commit is contained in:
34
GonghuiWeb/www/js/login2.php
Normal file
34
GonghuiWeb/www/js/login2.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?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);
|
||||
?>
|
||||
Reference in New Issue
Block a user