ウェブサイトを作成していますが、今のところ特定のユーザーのみが閲覧できるようにしたいと考えています。そのため、ユーザー/パスの検証を設定し、許可されているユーザー名とパスワードを含むいくつかの変数を設定しましたが、ランダムなユーザー名またはパスを入力してもサイトを表示できるため、エラーが発生しているようです。これは私のコードです:
login.php
<body>
<form action="check.php" method="get">
<Username:<input type="text" name="user" maxlength='8'>
<Password:<input type="password" name="password" maxlength='12'>
<input type="Submit" name="Submit" value="Submit">
</form>
<?php
print "<br><code> To proceed to the main page, please give the information and then click the button. You will be automatically be redirected.<br> </code>";
?>
</body>
check.php (情報をチェック)
<?php
$user1 = '';
$user2 = '';
$pass1 = '';
$pass2 = '';
$_GET['user'];
$_GET['password'];
if($_GET['user'] && ($_GET['password'] = $user1 && $user2 && $pass1 && $pass2)) {
header( "refresh:1;url=" );
} else {
echo 'You are unable to view this page yet, please try again later.';
}{
}
?>
どこが間違っているのかわかりませんか?私はかなり長い間試みてきましたが、成功していません。
編集
コードの一部を変更して並べ替えましたが、実際に誰が助けてくれたのかわかりません。