<?php session_start();
include("confic.php");
$adname=$_POST['username'];
if($_POST['username']&&$_POST['password']){
$rst=mysql_query("SELECT * FROM `".$ad."user` WHERE `username` LIKE '{$adname}'");
$rwt=mysql_fetch_assoc($rst);
 
if($rwt['password']==md5($_POST['password'])){
	    $_SESSION['name_login']="name_login";
            $_SESSION['name_admin']=$rwt['username'];
            $_SESSION['user_admin']=md5($rwt['username'].$rwt['password'].$md);
echo "<script language=javascript>  
alert( \"恭喜你，登陆成功\"  );
location.href = \"index.php\"
</script>";

}else 
die("<script language=javascript>  
alert( \"密码错误，请重新输入密码!\"  );
location.href = \"./username/login.php\"
</script>");
}
?>