登録用の index.php と、登録ハンドラとしての login.php があります。登録が失敗すると、エラー メッセージがクライアントに送信されます。このコードを使用してメッセージを送信します
header('Location: http://localhost/musicshare/index.php?reg=false');
そしてindex.phpで受け取ります
if(isset($_POST['reg'])){
echo 'set';//for checking whether reg is set
if($_POST['reg']=='false'){
echo '<script type="text/javascript">';
echo 'alert("Reg faile")';
echo '</script>';
}
}
ただし、まったく機能していないようです。助けてください、ありがとう。