<?php include("sql/conn.php"); 
session_start(); //开着身份验证，以后写
$llym = $_SERVER["HTTP_REFERER"];//记住来路的域名


/////////////////////////////////////判断当中的获得系统主要数据！
$result = mysql_query("SELECT * FROM adm WHERE id='1'");
while($row = mysql_fetch_array($result))
  {
  $_SESSION['adm'] = $row['adm'];/////管理员是谁
  $_SESSION['qf'] = $row['qf'];///////////签到得分
  $_SESSION['fk'] = $row['fk'];///////////发布扣分
  $_SESSION['hf'] = $row['hf'];///////////公会管理扣分
  $_SESSION['jlf'] = $row['jlf'];///////////公会管理扣分
  }
/////////////////////////////////////判断当中的获得系统主要数据！

$result = mysql_query("SELECT * FROM user where name ='".$_POST['name']."'");
while($row = mysql_fetch_array($result))
  {
           if($row['pass']==$_POST['pass'] and $_SESSION['yzm']==$_POST['yzm'])
			   {
			   //echo "用户名和密码正确";
$_SESSION['name'] = $_POST['name'];
$_SESSION['jf'] = $row['jf'];
$_SESSION['paty'] = $row['paty'];
$_SESSION['id'] = $row['id'];
$_SESSION['today'] = $row['today'];
$iipp = $_SERVER["REMOTE_ADDR"];
$noww = time();
mysql_query("UPDATE user SET nip = '".$iipp."' WHERE name = '".$_POST['name']."'");
mysql_query("UPDATE user SET nt = '".$noww."' WHERE name = '".$_POST['name']."'");

mysql_query("INSERT INTO text (name, time, ip, ing, f) 
VALUES ('".$_SESSION['name']."', '".$noww."', '".$iipp."', '登陆', '0')");

Header("Location: ".$llym);////返回来路的地址		       
               }
		   else
			   {
			   echo $_SESSION['yzm']."密码或验证码错误".$_POST['yzm'];
			   }
  }

include("sql/close.php"); 
Header("Location: index.php");////返回来路的地址
echo "<meta http-equiv=refresh content=0.1;url=index.php >";

?>
