php session if statement echo
I don´t know if this is possible, but im trying to make a session if
statement or something, like if the session name is "Simon" it will print
a specific text, if the session name is not "Simon" it will do nothing.
This is part of my code and it work:
Part of the user login page: $_SESSION['user'] = $row;
Part of the page i need the code on, now i just use it to print out the
name of the person logged in: session_start();
if(empty($_SESSION['user'])) { header("Location: index.php");
die("Redirecting to index.php"); }
echo htmlentities($_SESSION['user']['username'], ENT_QUOTES, 'UTF-8');
No comments:
Post a Comment