<?php session_start();  include("conn/conn.php");
$tb_user=$_POST[tb_user];
$tb_pass=md5($_POST[tb_pass]);
$query=mysql_query("select * from tb_voter where  tb_voter_name='$tb_user' and tb_voter_type='1'");
if(mysql_num_rows($query)>0){
	$queryes=mysql_query("select * from tb_voter where tb_voter_name='$tb_user' and tb_voter_pass='$tb_pass'");
	if($queryes==true){
		session_register("tb_user");
		echo "<script>alert('登录成功！');window.location.href='main.php';</script>";

	}else{
		echo "<script>alert('您输入的用户名或密码不正确！');window.location.href='index.php';</script>";

	}
}else{
echo "<script>alert('您的用户还没有进行验证，请登录您的注册邮箱进行验证后，在登录谢谢！');window.location.href='index.php';</script>";
}
?>