Re: [請益] 請問寫登入帳號密碼的問題
※ 引述《upingo (2009華航桌月曆預購中)》之銘言:
: 大家好:
: 請問一嚇,
: 我享用html+php來寫一個登入網頁
: 大致如下
: ------------------------------------------------
: <?
: if ($userid == "guest" && $userpw == "")
: Header("Location:index0.htm");
: else
: Header("Location:login2.htm");
: ?>
<?php
$arrayId = array("132","456","798","101");
$arrayPw = array("132","456","798","101");
$flag = FALSE;
if(isset($_POST['id']))
for($i=0;$i<count($arrayId);$i++)
if(($_POST['id'] == $arrayId[$i]) && ($_POST['password'] == $arrayPw[$i]))
$flag = TRUE;
($flag) ? header("Location: http://roga.tw") : die("boo");
?>
: 例如 id:abc passwd:1234
: or id:def passwd:1234
: 要如何在這個 php裡面寫呢?
: 感謝囉
: ps index0.htm 是參觀用的網頁
: index1.htm 是首頁
: login2.htm 是登入錯誤請重新登入的網頁
大概是這樣的方法..
--
凝視著,卻看不見光景。
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.130.223.207
※ 編輯: roga 來自: 211.23.32.124 (01/15 13:21)
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 3 篇):
PHP 近期熱門文章
PTT數位生活區 即時熱門文章