| < ? //引入文件config.inc.php,準(zhǔn)備使用變量$USER和 $PASSWORD include "config.inc.php"; //注冊一個(gè)session變量userpassword session_register("userpassword"); if ($user1==$USER and $password1==$PASSWORD){ //判斷登錄的用戶ID和PASSWORD是否正確 $userpassword=$user1.$password1; //假如正確就把ID和PASSWROD合并后的 //值保存到session變量$userpassword, header ("Location: index.php"); //并跳轉(zhuǎn)到測試頁index.php, exit(); //否則就停留在登錄頁login.php。 } ? > < HTML > < HEAD > < title >登錄頁< /title > < /HEAD > < BODY > < form method="POST" action="" > < div align="center" >< center > < table border="0" width="55%" height="153" > < tr > < td width="100%" align="center" height="47" > 管理員賬號(hào):< input type="text" name="user1" size="20" value="" >< /td > < /tr > < tr > < td width="100%" align="center" height="43" > 管理員密碼:< input type="password" name="password1" size="20" value="" >< /td > < /tr > < tr > < td width="100%" align="center" height="51" > < input type="submit" value="登錄" name="ok" class=wdBlack > < input type="reset" value="清除" name="B2" class=wdBlack >< /td > < /tr > < /table > < /center >< /div > < /form > < /body > < /html > |
|
|