<?php 
session_start(); //开着身份验证，以
include("../sql/conn.php"); /////写
header("Content-type: text/html; charset=utf-8"); 
$llym = $_SERVER["HTTP_REFERER"];
?>


<?php
if($_GET['dl']==dl)
{


$result = mysql_query("SELECT * FROM ".$b_qz."_zt " );/// DESC 
while($row = mysql_fetch_array($result))
{
$ksnr = $row['ksnr'];
}



$result = mysql_query("SELECT * FROM ".$b_qz."_ks where sfz ='".$_POST['sfz']."' and ksnr='".$ksnr."' ");

	if (mysql_num_rows($result) == 0 )//检查库里是否有这个用户名
	{
echo "<script>alert('身份证号出错！');</script>";
echo "<meta http-equiv=refresh content=0.1;url=".$llym." >";
exit;
	}

while($row = mysql_fetch_array($result))
	{
	
		if ($row['cj']>0)//检查库里是否有这个用户名
		{
		echo "<script>alert('考试完成，请离场！');</script>";
		echo "<meta http-equiv=refresh content=0.1;url=".$llym." >";
		exit;
		}
	
	
	$_SESSION['id'] = $row['id'];
	$_SESSION['name'] = $row['name'];
	$_SESSION['dw'] = $row['dw'];
	$_SESSION['sfz'] = $row['sfz'];
	$_SESSION['tel'] = $row['tel'];
	$_SESSION['ksnr'] = $row['ksnr'];
	}

echo "<script>alert('成功登陆！');</script>";
echo "<meta http-equiv=refresh content=0.1;url=".$llym." >";
exit;

}
?>



<?php
if($_GET['dl2']==dl2)
{


$result = mysql_query("SELECT * FROM ".$b_qz."_zt " );/// DESC 
while($row = mysql_fetch_array($result))
{
$ksnr = $row['ksnr'];
}



$result = mysql_query("SELECT * FROM ".$b_qz."_ks where name ='".$_POST['xm']."' and dw ='".$_POST['dw']."' and ksnr='".$ksnr."' ");

	if (mysql_num_rows($result) == 0 )//检查库里是否有这个用户名
	{
echo "<script>alert('姓名出错！');</script>";
echo "<meta http-equiv=refresh content=0.1;url=".$llym." >";
exit;
	}

while($row = mysql_fetch_array($result))
	{
	
		if ($row['cj']>0)//检查库里是否有这个用户名
		{
		echo "<script>alert('考试完成，请离场！');</script>";
		echo "<meta http-equiv=refresh content=0.1;url=".$llym." >";
		exit;
		}
	
	
	$_SESSION['id'] = $row['id'];
	$_SESSION['name'] = $row['name'];
	$_SESSION['dw'] = $row['dw'];
	$_SESSION['sfz'] = $row['sfz'];
	$_SESSION['tel'] = $row['tel'];
	$_SESSION['ksnr'] = $row['ksnr'];
	}

echo "<script>alert('成功登陆！');</script>";
echo "<meta http-equiv=refresh content=0.1;url=".$llym." >";
exit;

}
?>


<?php include("../sql/close.php"); /////写?>



