<?php include("conn.php") ?>
<?php include("session.php");?>
<?php 
	  $read_studentid=trim($_GET["studentid"]);
	  $read_password=trim($_GET["password"]);
?>
<?php 
	 
	    $return_msg="z"."enter";
	    $flag=0;
?>
     
<?php  
     
	  $classname_str=strtoupper("Internet");
	
	  $sql="select * from studentinfo where studentid='".$read_studentid."'";
	 
  	  $rs=$conn->execute($sql);
	  if($rs->EOF)
	  {    
	        $return_msg="a"."【软件提示】：准考证号【".$read_studentid."】没有注册，请询问考场教师.";
		    $flag=1;
	        $rs->close;
	  
			$cc=$return_msg;
	        echo ltrim($cc);
	        $rs->close;
	        $conn->close;
	        exit;
	 }
	 ?>
	 
<?php 
     
	 if ($flag==0)
      {	
      
	   $sql="select * from studentinfo where studentid='".$read_studentid."'";
	 
  	   $rs=$conn->execute($sql);
	   if(!$rs->EOF)
	   {
	      $read_stu_name=$rs->fields["name"];
  		  $read_stu_class=$rs->fields["testclassname"];
		  $read_db_password=trim($rs->fields["password"]);
		  
	      if ($read_db_password!=$read_password) 
	      {
			   $return_msg="b"."【软件提示】：密码输入错误，请仔细检查.";
		       $flag=1;
	           $rs->close;
	           
			   $cc=$return_msg;
	           echo ltrim($cc);
	           $conn->close;
	           exit;
	      }
		  else
		  {  
		       
			   $_SESSION["studentid"]=$read_studentid;
			   
			   
			   $return_msg="c"."登录成功，请不要用一个帐号同时打开两个以上窗口进行练习。\n";
		       $return_msg=$return_msg."如果是客观性试题 [单选] [多选] [判断] 题型，则交卷完毕，自动阅卷，立即给出成绩.";
		       $flag=1;
	           $rs->close;
	           
			   $cc=$return_msg;
	           echo ltrim($cc);
	           $conn->close;
	           exit;
			  
		  }
	  }
	  
	  }
	 
	 
	  ?>
      
    
     
      <?php 
	 
	  $cc="";
	  //'------------------将中文--编码----成%20%35--------------
	  //$cc=urlencode(trim($return_msg));
	  $cc=$return_msg; 
	  echo ltrim($cc);
	  $rs->close;
	  $conn->close;
		
    ?>
  