雄 之 論 壇

標題: [求助] 怎將PHP碼,由一個用戶增加多個登入用戶 [打印本頁]

作者: 小舀    時間: 2020-2-7 09:10 PM     標題: 怎將PHP碼,由一個用戶增加多個登入用戶



[ 按此複制以下內容 ]
<?php
$username = "pe";
$password = "pe";


if ($_POST['username'] == $username && $_POST['password'] == $password){


echo '成功登入';

}

else {
echo '<div align="center"><h1>登入錯誤,請重新登入。</h1></div>';
echo '<div align="center"><h2><a href="2.html" target="_blank">返回</a></h2></div>';
}
?>


作者: 小舀    時間: 2020-2-7 09:11 PM

試過這樣增加是不行的

[ 按此複制以下內容 ]
<?php
$username = "pe";
$password = "pe";
$username = "pe2";
$password = "pe2";
$username = "pe3";
$password = "pe3";


if ($_POST['username'] == $username && $_POST['password'] == $password){


echo '成功登入';

}

else {
echo '<div align="center"><h1>登入錯誤,請重新登入。</h1></div>';
echo '<div align="center"><h2><a href="2.html" target="_blank">返回</a></h2></div>';
}
?>


作者: 別問我是誰    時間: 2020-2-8 12:33 AM



引用回應
原帖由 小舀 於 2020-2-7 09:11 PM 發表。
試過這樣增加是不行的
<?php
$username = "pe";
$password = "pe";
$username = "pe2";
$password = "pe2";
$username = "pe3";
$password = &qu ...



[ 按此複制以下內容 ]
<?php
$username = "pe";
$password = "pe";
$username2 = "pe2";
$password2 = "pe2";
$username3 = "pe3";
$password3 = "pe3";

if (($_POST['username'] == $username && $_POST['password'] == $password) || ($_POST['username'] == $username2 && $_POST['password'] == $password2) || ($_POST['username'] == $username3 && $_POST['password'] == $password3)){






歡迎光臨 雄 之 論 壇 (http://lthung.org/forum/) Powered by Discuz! 5.0.0