<?php
 session_start();
 else{
  	$user=$_POST['user'];
  	$password=md5($_POST['password']);
  	$safecode=$_POST['safecode'];
  	if($safecode!=""&& $safecode=$_SESSION['randode']){
  	 $sql="select * from user where user=$user and password=$password";
  	 if(mysql_query($sql)){
  	 	
  	 	echo "<script>alert('登陆成功！');window.location.href:\"index.php\";</script>";
  	 }else {
  	 	echo "<script>alert('用户名或密码错误！');history.back();</script>";
  	 }
  	}else{
  		echo "<script>alert('验证码错误');history.back();</script>";
  	}
  }
?>