Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ユーザーが新しいタブを開いて、自分のページの index.php をユーザーページに入力した場合にユーザーをリダイレクトする方法は? これを行うには、index.php に何を入れますか? 私はPHPが初めてです。
このようなもの:
session_start(); if (isset($_SESSION['user'])) { header('Location: user_page.php'); }
index.php で、これより上に HTML コードやスペースがないことを確認してください。
この質問は、stackoverflow で多く回答されているように感じます。
header("Location:filename") exit();