<?
@include("phpconn.php");

function alerturl($alertstr,$url)
{
  echo "<script>";
  echo "alert('".$alertstr."');";
  echo "location.href='".$url."';";
  echo "</script>";
  exit;
}

function gotourl($url)
{
  echo "<script>";
  echo "location.href='".$url."';";
  echo "</script>";
  exit;
}
?>

<?
$user_name=$_GET["user_name"];
$password=$_GET["password"];
$cookies_time=$_GET["cookies_time"];

$password_2=$_GET["password"];

if($passwordtype==2) $password_2=substr(md5($password_2),8,16);
if($passwordtype==3) $password_2=md5($password_2);

 $sql="select * from $saveregtable where $saveregusername='$user_name'";
 $result=mysql_query($sql);
 $rs=mysql_fetch_array($result);
 
 if ($rs[$saveregusername]=="") alerturl("没有此用户","index.asp");
 if ($rs[$saveregpassword]<>$password_2) alerturl("密码错误","index.asp");
 
 $check=Rand(1,99999999);
 $checkcode=md5($check.$syscode);

 gotourl("phploginok.asp?user_name=$user_name&password=$password&cookies_time=$cookies_time&check=$check&checkcode=$checkcode");
?>