0

Hi, This is a part of my code..I'm making a Post form

if(!isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID']) !== '')){
            print "<tr><th>Email1: </th>
      <td><input name=\"email\" type=\"text\" class=\"textfield\" id=\"email\" /></td>
        </tr>";
        print "SESS not set"; //////////////////for test
        }

 if(isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID']) !== '')){
            $memberEmail = $_SESSION['SESS_MEMBER_ID'];
            print $memberEmail;/////////////////for test
            print "<input name=\"email\" type=\"hidden\" value=\"{$memberEmail}\"class=\"textfield\" id=\"email\" />";
        }

If session is NOT set (user NOT loggedin) then shows "Email" form field other wise just add the value in a hidden field.
But...it works both !isset and isset. It shows moth test prints : (

I cannot understand what is the problem.

Or please tell me other way to do this. Thanks.

3
Contributors
2
Replies
3
Views
4 Years
Discussion Span
Last Post by LastMitch
1

Ok, but both IF statements have the same OR clause (!== ''). Which, if evaluates to TRUE will mean your other condition (!isset) isn't tested.

0

@holosoft

If session is NOT set (user NOT loggedin) then shows "Email" form field other wise just add the value in a hidden field.
But...it works both !isset and isset. It shows moth test prints

My question is why are you using isset as a form? May I ask what do you want to do? Is this for logging in and logging out from a account? or members signing up for an account? What form is this? I can't help you if you didn't explain clearly what you need help with.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.