???? ????? ??? (2) ??? ??
?? ??? ?? ? ????? ??? ??? ???? ???? ??? ?? ???????. ?? ????? ??? ??? ?? ???????. ???? ??? ?? ??? ???? ??? ???????.
login.php ??? ??? ????.
<?php session_start (); require_once("../config/config.php"); $password = $_POST['password']; //查詢數(shù)據(jù)庫 然后取出數(shù)據(jù)庫的信息,如果和表單提交的信息一致,則登錄成功,進(jìn)入后臺管理 $sql = "select * from admin where password='$password'"; $res = mysql_query($sql); $row = mysql_fetch_row($res); if($row){ echo "<script>alert('登錄成功')</script>"; echo "<script>location.href='index.php'</script>"; }else{ echo "<script>alert('登錄失敗')</script>"; echo "<script>history.go(-1);</script>"; //登錄失敗返回上一個頁面 } ?>
??????? ??? ? sql? ?????. ??? ?? ??? ??? ??????? ???? ??? ??? ???? ???????? ??? ??? ??? ????? ???? ???? ???? ? ????. ???? ???? ???? ?????. ???? ???? ???? ???? ??? ?? ??? ???? ?????.