php change sign in to sign out after user signs in

前端 未结 1 1807
没有蜡笔的小新
没有蜡笔的小新 2020-12-22 14:22

signin.php:



        
相关标签:
1条回答
  • 2020-12-22 14:38

    In place of

    <li><a href="signin.php">Sign in</a></li>
    

    you need

    <li>
        <?php
            if(isset($_SESSION['username'])) { ?>
                <a href="signout.php">Sign out</a>
        <?php 
            } else { ?>
                <a href="signin.php">Sign in</a>
        <?php
            } ?>
    </li>
    

    BUT

    You have massive security issues there. You're storing passwords in plain text in your database, by the looks of it. You need to fix this. Now.

    0 讨论(0)
提交回复
热议问题