I have this little script I'm trying to simply logout here it is.. PHP Code: <?php
session help
1
I have this little script I'm trying to simply logout here it is..
ok so what I'm saying is if the session isn't set would mean they are not logged in to logout right? then echo the sorry.. and exit.
else if the logout button was pressed destroy the session and echo success pretty straight forward
now if I change that and echo out that $username1 = $_SESSION['username'] echos fine so that tells me that the session is set ??? dosn't it?
issue is i'm always getting the sorry your not logged in but not the username??
what am I doing wrong here?
PHP Code:
<?php
session_start();
include("connect.php");
$username1 = $_SESSION['username'];
if (!isset($_SESSION['$username'])) {
echo "Sorry Your Not Logged In" . $_session['username'];
exit();
}
else if (isset($_GET['logout'])) {
session_destroy();
echo "You Have Been Successfully Logged Out";
}
?> else if the logout button was pressed destroy the session and echo success pretty straight forward
now if I change that and echo out that $username1 = $_SESSION['username'] echos fine so that tells me that the session is set ??? dosn't it?
issue is i'm always getting the sorry your not logged in but not the username??
what am I doing wrong here?
- phpg
Next Topics on Trending Feed
-
1