Forum Moderators: coopster
Parts of the code:
functions.php
function isLogged() {
return (defined('USERID'));
}
login.php
header("Location: index.php");
index.php
if(!isLogged()) { echo "not logged in"; }
else {
echo "logged in";
}
it echos not logged in.
and then when i refresh the page it echoes logged in.
thank you
welcome to Webmasterworld. It looks like you're facing a problem with caching here: your browser does not request the current page until you refresh it manually.
things to do:
header("Location: urlofmainpage[b]?".uniqid(rand(), true)."=".uniqid(rand(), true)[/b]); hope this helps,
hakre
it goes like this:
function isLogged() {
return (defined('USERID'));
}
session_start();
setGlobalVars();
and any time that i want to log in i do:
if(!isLogged()){
echo "error";
}
else{
echo "content";
}