Hi,

I have login logout problem.when i LOGED IN i want my login button change it logout.But its not beahave like this.here is my code please see and help with neccessary steps:

<?php 
        if(isset($_SESSION['user_active_status'])=='1')
        {
            ?>
<div class="user_purpose">
                <ul>
                <a href="index.php?page_select=page_logout124" style=" font-family: calibri; color: white;"><li class="user_log">Logout</li></a>      // page_select : page_logout124 //
                </ul>
                </div>
                <?php
                }else{ ?>
                         <div id="user_purpose">
                <ul>
                <!-- <li class="us_log"><a href="./index.php?page_select=page_reg124">Register</a></li>-->
                    <a href="./index.php?page_select=page_login125" style=" font-family: calibri; color: white;"><li class="user_log">Login</li></a>    // page_select : page_login125 //
                </ul>
            </div>
                 <?php   }  ?>

OR if you have any good refference please you do i will accept.
Thanks

Where is your Login/Logout button?

Assign your button a name (ie/ button_1), then use your existing IF statement.

if(isset($_SESSION[user_active_statue] == 1))
{
    $button_1 = "Logout";
}
else {
    $button_1 = "Login In";
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.