|
|
发表于 2013-7-16 22:09:59
|陕西|
显示全部楼层
$email = trim($_POST['email']);
5 i- f/ v' O+ S& X $pwd = trim($_POST['pwd']);9 G; g; D$ m/ V: g& q5 F: y
$cktime = $_POST['cktime'];
: {$ y/ q7 h/ N* S4 w9 A% D
6 @6 m; ^ h& a0 t if($email=='' || $pwd=='') qiMsg("所有输入项都不能为空^_^");# j5 {; i' F k0 K' U7 C% K
* O4 j4 d( K _# r8 D( b! u $countAdmin = $db->once_fetch_assoc("select count(*) from ".dbprefix."user where `email`='$email'");3 v8 X+ Z" Y' T5 r# y$ p. ]
5 I5 y$ ?7 `/ P
if($countAdmin['count(*)'] == 0) qiMsg('用户Email不存在!');" i1 d9 J) ]1 j. Z* _8 u
9 N. }0 b n3 K; G $strAdmin = $db->once_fetch_assoc("select * from ".dbprefix."user where `email`='$email'");; m; ^$ B. {- ]( @2 l$ r% n
( K# T" ?/ O0 O9 B, n8 l if(md5($strAdmin['salt'].$pwd)!==$strAdmin['pwd']) tsNotice('用户密码错误!'); 4 B- ^! Z* `) K9 g
# f0 _8 |% `* U; {; v2 p/ D5 L
$strAdminInfo = $db->once_fetch_assoc("select userid,username,isadmin from ".dbprefix."user_info where email='$email'");/ b- e1 E+ l0 w3 `" j- e4 r6 ^
& E) @4 q, Q9 W* P% Q if($strAdminInfo['isadmin'] != 1) qiMsg("你无权登录后台管理!");' Z0 |% d8 W" \8 h; K9 Z
4 ~2 w0 L2 n" \; s1 H, z3 z
$_SESSION['tsadmin'] = $strAdminInfo;# |# I6 f u4 o- f* N P% C
, ]7 K5 ]% m( W( ^
header("Location: ".SITE_URL."index.php?app=system");
" G9 h6 S& I" m" h% Q; T" q K# H( I. C, X" I8 d
|
|