php - after signing up it still shows sign up -
i have code :
if(!isset($_session['email']) && empty($_session['email'])) { ?> <a class="more float_l" href="signup.php">sign up/login</a> <?php } else { ?> <a class="more float_l" href="post/logout.php">logout</a> <?php } ?>
now working correctly when user not logged in displays sign or login , when user login redirect home.php , displays logout button problem when signup , redirect home.php still displays sign or login, please me solve problem.
some possibilities of may have gone wrong, ignoring the fact didn't provide login script:
- the login script did not set $_session['email'] correctly or left empty; or
- you miss session_start(); in login script and/or in one.
i have edited script bit, may work better:
<?php session_start(); if(isset($_session['email']) && !empty($_session['email'])): ?> <a class="more float_l" href="post/logout.php">logout</a> <?php else: ?> <a class="more float_l" href="signup.php">sign up/login</a> <?php endif; ?>
Comments
Post a Comment