I need a script that replaces "login" with "logout" when im logged in and vice versa. Anyone know of a god tutorial that teaches how to do this?
luke.belleghem
0
Newbie Poster
Recommended Answers
Jump to PostAssuming you have created a session then all you need to do is check whether or not it has been set, like so:
<?php if(isset($_SESSION['SESSION_NAME'])) { ?> <a href = "/Logout.php" > Logout </a> <?php } if(!isset($_SESSION['SESSION_NAME'])) { ?> <a href = "/Login.php" > Login </a> <?php …
All 4 Replies
Octet
45
Newbie Poster
Featured Poster
broj1
356
Humble servant
Featured Poster
luke.belleghem
0
Newbie Poster
Octet
45
Newbie Poster
Featured Poster
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.