0
ログインしようとしたが既にログインしていて、以前にその環境設定を選択した場合、ユーザーをerror.htmlにリダイレクトしたい。mysqlのフィールドが完了した場合にリダイレクト
私はif ($rows['attendance'] == "yes") || ($rows['attendance'] == "no"); { header('location: error.html');
を追加しました。mysqlの出席者フィールドには、以前にログインしてその環境設定を選択した場合、はいまたはいいえがあります。しかし、上記のコードは私
// Check username and password match
if (mysql_num_rows($login) == 1) {
// Set username session variable
$_SESSION['username'] = $_POST['username'];
// Jump to secured page
$row = mysql_fetch_array($login);
switch ($row['attendance']):
case 1:
header('Location: page1.php');
exit;
case 2:
header('Location: page2.php');
exit;
case 3:
header('Location: page3.php');
exit;
case 4:
header('Location: page4.html');
exit;
case 5:
header('Location: page5.html');
exit;
endswitch;
if ($rows['attendance'] == "yes") || ($rows['attendance'] == "no"); {
header('location: error.html');
}
}
else {
// Jump to login page
header('Location: login.php');
}
?>
enter code here
まだ動作していません。 broswerページには、上記のスクリプトがあるページの場所が表示されます。したがって、コードを実行しますが、実際には何もしません。 – user1191294
@ user1191294ヘッダーは、大文字 - 'L'、 'Location'でなければなりません。 – Borealid
同じことをやり続けているのは – user1191294