<?php
session_save_path(dirname(__FILE__).'/../include/session_lmcms/');
session_start(3600); 
?>
<?php
include("include/config.php");//引入公共变量文件
include("include/common.php");//引入公共变量文件
$uyzm = $_POST['useryzm'];
$uname = cinput($_POST['username']);
$upass = md5(cinput($_POST['upassword']));
$getip = getip();
$getdate = date('Y-m-d H:i:s');
$loginyzm = isset($_SESSION['loginyzmkey']) ? $_SESSION['loginyzmkey'] : '';
if($uyzm!=$loginyzm){
	viewmsg('验证码不正确','signin.php');
exit();
	}
//查找数据库是否有该用户
$sqlstr="select * from limao_admin where lm_username='".mysql_real_escape_string($uname)."' and lm_password='".mysql_real_escape_string($upass)."' limit 1";
$rs = limaors($sqlstr);
$rows=mysql_fetch_assoc($rs);
if($rows){
		$_SESSION['gameuser'] = $uname;
		$_SESSION['gamekey'] = md5($uname);
		limaors("update limao_admin set lm_userlateip='$getip',lm_userlatetime='$getdate' where lm_username='".mysql_real_escape_string($uname)."'");
		limaors("insert into limao_log(lm_userid,lm_logintime,lm_loginip,lm_error) values('".mysql_real_escape_string($uname)."','$getdate','$getip','NO')");
		viewmsg('登陆系统成功','index.php');
	}else{
		viewmsg('用户和密码错误','signin.php');
		}

?>