I am programming in PHP.
I want to do a page that if the user didn't signed in, the system will say "Hello Guest" and if he signed in, the system will say "Hello $username".
It's working, however, when I entered the system for the first time I receive a error undefined $Username. After I refresh the page or going to another page it's working good - the problem is in the first time.
The $username received in the login page and there is session_start();
.
This code is from the page I am trying to do the Hello Username:
<?php
if (!isset($_SESSION))
session_start();
if ($_SESSION["Username"] == "")
$_SESSION["Username"] = "Guest";
?>
Need help