Possible Duplicate:
Why I have to call ‘exit’ after redirection through header(‘Location..’) in PHP?
In order to not be able to acces the mainpage.php without loggin in, I start the mainpage.php with following code:
<?php
session_start();
if(!isset($_SESSION['name'])){
header("Refresh: 0; url=hauptseite_slim.php");
}
?>
<!DOCTYPE html>
...
This does exactly what I want, but, the problem is, it is very ugly, because for a little moment, there mainpage shows up. How can I avoid this effect?