joda
02-19-2012, 02:33 PM
Hi!
I made this code as a function:
function isLoggedIn()
{
session_start();
if (isset($_SESSION['ulogovan']))
{
echo 'You are logged as: ' . $_SESSION['ulogovan'];
}
else
{
echo 'Your are not logged...';
header("location:login_form.php");
}
}
Ok, the problem is:
If I upload the whole project to my web server and try the code I got all the time the error because of the "header()" function and php.ini settings something like this:
Warning: session_start() [function.session-start]: Cannot send session cache limiter...
or
Warning: Cannot modify header information - headers already sent by...
Ok, I know why this happen but how to make an IF-ELSE checking and redirecting to another page if the ELSE statement is reached without the "header()" function?
BUT!
I have to track the logged user session too so I know on other pages if the real logged in user are the one who visits the member area...
I have no option to change the php.ini file on the server because it is out of my administration reach and I have no access to that.
Any idea?
I made this code as a function:
function isLoggedIn()
{
session_start();
if (isset($_SESSION['ulogovan']))
{
echo 'You are logged as: ' . $_SESSION['ulogovan'];
}
else
{
echo 'Your are not logged...';
header("location:login_form.php");
}
}
Ok, the problem is:
If I upload the whole project to my web server and try the code I got all the time the error because of the "header()" function and php.ini settings something like this:
Warning: session_start() [function.session-start]: Cannot send session cache limiter...
or
Warning: Cannot modify header information - headers already sent by...
Ok, I know why this happen but how to make an IF-ELSE checking and redirecting to another page if the ELSE statement is reached without the "header()" function?
BUT!
I have to track the logged user session too so I know on other pages if the real logged in user are the one who visits the member area...
I have no option to change the php.ini file on the server because it is out of my administration reach and I have no access to that.
Any idea?