HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/xampp/htdocs/Xerox/connect.php
<?php session_start(); ?>
<!--上方語法為啟用session,此語法要放在網頁最前方-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
//連接資料庫
//只要此頁面上有用到連接MySQL就要include它

$id = $_POST['id'];
$pw = $_POST['pw'];


if($id != null && $pw != null && $id=='xerox' && $pw== 'bynumber')
{
        //將帳號寫入session,方便驗證使用者身份
        $_SESSION['account'] = $id;
        echo '登入成功!'.$id;
        echo '<meta http-equiv=REFRESH CONTENT=1;url=indexX.php>';
}
else
{
        echo '登入失敗!';
       // echo '<meta http-equiv=REFRESH CONTENT=1;url=index.php>';
}
?>