CODE
<?php
session_start();
include ("functions.php");
check_login();
?>
session_start();
include ("functions.php");
check_login();
?>
this checks if my client is logged in or not.
If yes, than it is showing some info that i put just under it.
If not, than its putting the login form.
___
What i went is IF the client is not login i want him to be redirected to login.php, right now what it does is it takes the code from login.php and put it inside this page (in case he is not logged in)... i don't want that this code brings the form but i want this code to redirect the client to the form (login.php)
This is my function.php :
CODE
<?php
if (eregi ("functions.php",$_SERVER['PHP_SELF'])) die ("<font color=\"red\">error</font>");
function check_login ()
{
if (!isset ($_SESSION['loggedin']) && !isset ($_SESSION['time']))
{
require ("login.php");
die ();
}
else
{
session_start();
}
}
ob_start();
?>
if (eregi ("functions.php",$_SERVER['PHP_SELF'])) die ("<font color=\"red\">error</font>");
function check_login ()
{
if (!isset ($_SESSION['loggedin']) && !isset ($_SESSION['time']))
{
require ("login.php");
die ();
}
else
{
session_start();
}
}
ob_start();
?>
I thought of puting some meta redirect code inside the else { } but i really suck at php, and donno what to really do.
Thanks for the help
Oh also, if anyone knows a logout script. (donno if any logout scripts work or do i need a specific one taken from my login)
Thanks :
