index.php 录入页代码
login.php提交页代码
error_reporting(0);
$mysql_servername = "127.0.0.1";
$mysql_username = "root";
$mysql_password ="123456";
$mysql_database ="first";
mysql_connect($mysql_servername , $mysql_username , $mysql_password);
mysql_select_db($mysql_database);
$U_name=$_POST['user_name'];
$U_passowrd=$_POST['user_password'];
if ($U_name && $U_passowrd){
$sql = "SELECT * FROM admin WHERE U_name = '$U_name' and U_password='$U_passowrd'";
$res = mysql_query($sql);
$rows=mysql_num_rows($res);
if($rows){
header("location='c.php'");
exit;
}
echo "";
}else {
echo "";
}
?>