PHP Exit problem

I’m setting up a login as an include file, below is ‘what i think’ the root of the problem, the last line is going to be the body of the index page, but i can get it to display/print. How do I get this text ‘body text’ to show no matter what happens before?

<?php session_start(); if(isset($_SESSION['login'])) { } else { ?>

Login

<?php exit; } ?>

body text

Instead just exit, you can have it redirect to the same page after user login. So, that first time user will see login form and body text, and after they login - you redirect to this same page, but user already will be logged in and again, can see body text.

Sponsor our Newsletter | Privacy Policy | Terms of Service