I have a login page when clicked on defines the variable $_session[username] = $name;
this $_session['username']
is displayed on my main page and it works fine if someone does login. however when someone does not login, the error notice:undefined index pops up. if i use
<?php session_start(); if($_SESSION['username']==""|| isset($_SESSION['username'])){echo "Login";}else{echo "Logout";}?>
i thought it would fix the problem. but it has the same error