Jump to content

[SOLVED] Using headers for timed redirect if user is not logged in.


Teng

Recommended Posts

I want it so that when a user tries to say type in a page... userdetails.php and is not logged in it says sorry you are not logged in you will be redirected to the login page in 5 seconds.

 

Atm in my code i have

 

<?php

session_start();

 

.............

.............

 

if (isset($_SESSION['userid']))

{

                    ............

                    ............

            }

            else

{

echo '<p>You are not logged in.</p>';

echo '<p>Only logged in users may see this page.</p>';

}

?>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.