Example:
Code: Select all
if(isset($_SESSION['idmember']))
{
//the pages code.
} else {
echo "you must be logged in";
}
Moderator: General Moderators
Code: Select all
if(isset($_SESSION['idmember']))
{
//the pages code.
} else {
echo "you must be logged in";
}
Code: Select all
if (!isset($_SESSION['whatever']))
{
// They need to login
}How so? The existing if redirects them if they aren't logged in. No need for any additional conditionals.Markto wrote:But that would still nest all of my code in this big "if" statement.