1

サインイン (signin.php を使用) した後、自分のページに自分のhttp_referer場所を設定するにはどうすればよいですか。logout.phpphp & http_referer が joomla.php になったので、logout.php を設定できますか

  1. コード: Signin.php

    $referer = $_SERVER['HTTP_REFERER'];
    echo $referer;
    if ($referer == 'http://localhost/MinProject/reg.php')
    {
        echo "Registration SuccessFully";
    }
    
    else if($referer=='http://localhost/MinProject/changepassword.php')
    {
        echo"Change Password SuccessFully";
    }
    
  2. joomla.php

    <html>
        <body>
            <table width="100%">
                <tr>
                    <td width="20%" height="32" align="right" class="unm">
                        <?php
                        session_start();
                        if(isset($_SESSION['username']))
                        {
                            $name =$_SESSION['username'];
                            echo "Welcome ".$name;
                         }
                        ?>
                    </td>
                    <td width="64%" height="32" align="right">
                        <a href="changepassword.php">ChangePassword</a>
                    </td>
                    <td width="10%" align="right">
                        <a href="logout.php">logout</style></a>
                    </td>
                    <td width="11%"></td>
                    <td width="5%"></td>
                    <td width="5%"></td>
                    <td width="5%"></td>
                </tr>
            </table> 
        </body>
    </html>
    
  3. logout.php

    session_start();
    unset($_SESSION['username']);
    session_destroy();
    response.setHeader("Location: http://localhost/MinProject/logout.php");
    header("Location: Signin.php");
    exit();
    
4

1 に答える 1