This question already has an answer here:
- Reference - What does this error mean in PHP? 34 answers
- How do I make a redirect in PHP? 31 answers
I'm having issues with my simple PHP script. I want if $_SESSION['username']
is set to redirect to welcome.php
, if not, it goes to /login.php
I thought it would be easy but i seem to have some issues.
INDEX.php
<?php
session_start();
if(isset($_SESSION['username']))
{
header("Location","/welcome.php");
}
else
{
header("Location","/login.php");
}
?>
</div>