-2

This is really annoying, i dont get it... Icheck the Isset and if not then i assign the veraialbe.. But i get to the next check and allthough the veriable should be set its then not... And why does the if(!isset($_SESSION['foo'] through a hissy fit if theres no veriable/index, i dont get it, thats the whole point of (!isset aint it.. anyway, look at my code. can anybody see a reason why this would not be set.. Thanks..

SESSION['loggedin'] problem.

        if ($_SESSION['homepage']='001') {$_SESSION['message']==$_SESSION['message']; unset($_SESSION['homepage']);} // if message comes from anything other than the login post

        (!isset($_SESSION['homepage'])) { $_SESSION['message']==$_SESSION['message']}; // if message comes from anything other than the login post

        if (isset($_SESSION['loggedin'])) {$_SESSION['loggedin']=$_SESSION['loggedin'];} else {$_SESSION['loggedin=']='000';} 

if (!isset($_SESSION['loggedin'])) {$_SESSION['loggedin']='000';}

        if (!isset($_SESSION['message'])) { $_SESSION['message']='Please Log into an Account';}



if (isset($_POST['email'])) {
unset($_POST['email']);
unset($_POST['confirmemail']);
unset($_POST['password']);
unset($_POST['confirmpassword']);
}
    else
    if (isset($_POST['email'])) {
    unset($_POST['email']);
    unset($_POST['confirmemail']);
    unset($_POST['password']);
    unset($_POST['confirmpassword']);
    }
        else
        if (isset($_POST['confirmemail'])) {
        unset($_POST['email']);
        unset($_POST['confirmemail']);
        unset($_POST['password']);
        unset($_POST['confirmpassword']);
        }
            else
            if (isset($_POST['confirmpassword'])) {
            unset($_POST['email']);
            unset($_POST['confirmemail']);
            unset($_POST['password']);
            unset($_POST['confirmpassword']);
            };


          ........THROWS index not defined here......
if (!isset($_SESSION['loggedin'])) 
{$_SESSION['loggedin']=='000'; 
$_SESSION['message'] = 'You are NOT Logged into your account <br> Please Log in';}
Shane Dee
  • 1
  • 4

1 Answers1

0
    if ($_SERVER["REQUEST_METHOD"] == "POST") {

        if ($_SESSION['homepage']='001') {$_SESSION['message']==$_SESSION['message']; unset($_SESSION['homepage']);} // if message comes from anything other than the login post

        (!isset($_SESSION['homepage'])) { $_SESSION['message']==$_SESSION['message']}; // if message comes from anything other than the login post

        if (isset($_SESSION['loggedin'])) {$_SESSION['loggedin']=$_SESSION['loggedin'];} else {$_SESSION['loggedin=']='000';} 

        if (!isset($_SESSION['message'])) { $_SESSION['message']='Please Log into an Account';}

    } else { $_SESSION['loggedin=']='000'; $_SESSION['message']='Please Log into an Account'; }



if (isset($_POST['email'])) {
unset($_POST['email']);
unset($_POST['confirmemail']);
unset($_POST['password']);
unset($_POST['confirmpassword']);
}
    else
    if (isset($_POST['email'])) {
    unset($_POST['email']);
    unset($_POST['confirmemail']);
    unset($_POST['password']);
    unset($_POST['confirmpassword']);
    }
        else
        if (isset($_POST['confirmemail'])) {
        unset($_POST['email']);
        unset($_POST['confirmemail']);
        unset($_POST['password']);
        unset($_POST['confirmpassword']);
        }
            else
            if (isset($_POST['confirmpassword'])) {
            unset($_POST['email']);
            unset($_POST['confirmemail']);
            unset($_POST['password']);
            unset($_POST['confirmpassword']);
            };



if (!isset($_SESSION['loggedin'])) 
{$_SESSION['loggedin']='000'; 
$_SESSION['message'] = 'You are NOT Logged into your account <br> Please Log in';}

I was == in stead of = . plus i added a check if post. Thanks for the REVIEW.

Shane Dee
  • 1
  • 4