时间:2021-07-01 10:21:17 帮助过:11人阅读
//user login
if (isset($_POST['username']) && isset($_POST['password'])
&& !empty($_POST['username']) && !empty($_POST['password'])
) {
try{
$username = $_POST['username'];
$password = $_POST['password'];
$rs = $config[DAOIMPL]->getLoginByName($username);
$arr = mysql_fetch_array($rs);
//echo $arr['sys_user_passwd'];
if ($arr && $arr['sys_user_passwd'] == generateUserPassword($password)) {
$_SESSION[SESSIONUSER] = $username;
echo '';//跳转到根目录下的index.php
}else {
echo "";
exit(0);
}
}
catch (Exception $e){
echo "";
exit(0);
}
}
if (isset($_POST['username']) && isset($_POST['password']) && !empty($_POST['username']) && !empty($_POST['password'])) {如果登录成功,会弹出“验证成功”对话框,你有吗?
$username = $_POST['username'];
$password = $_POST['password'];
$rs = $config[DAOIMPL]->getLoginByName($username);
$arr = mysql_fetch_array($rs);
if ($arr && $arr['sys_user_passwd'] == generateUserPassword($password)) {
$_SESSION[SESSIONUSER] = $username;
echo '';
echo '';
}else {
echo "";
}
}