1234567891011121314151617181920212223 |
- <?php
- session_start();
- include("connect.php");
- $id = $_POST['id'];
- //搜尋資料庫資料
- $sql = "SELECT * FROM accounts where account = '$id'";
- $result = mysql_query($sql);
- $row = @mysql_fetch_row($result);
- //判斷帳號與密碼是否為空白
- //以及MySQL資料庫裡是否有這個會員
- if($id != null && $row[1] == $id){
- //將帳號寫入session,方便驗證使用者身份
- $_SESSION['id'] = $row[0];
- $_SESSION['name'] = $row[1];
- header('Location: 000.php');
- exit;
- }
- else{
- header('Location: check.php');
- exit;
- }
- ?>
|