Link to home
Start Free TrialLog in
Avatar of Graeme McGilvray
Graeme McGilvrayFlag for Australia

asked on

IF statment with interesting variables

Hi there, I am not too sure how to arrange this IF statement

these are the variables

Session("AdminLogin")=TRUE
' admin can see their pages
Session("Login")=TRUE
' client can see their pages
Session("AdminLogin")=TRUE OR Session("Login")=TRUE
' both admin and client can view shared pages

Its prob very simple, however I cannot see how to do it :/
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

so actually you got 3 types of pages.

1. shared pages
2. admin pages
3. client pages

it's depends on where you want to show those content, and then just do the validations that you already listed above, which means:

1. in an area to show shared page, do validation of:

if Session("AdminLogin")=TRUE OR Session("Login")=TRUE then
   'show your shared page
end if

2. in an area to show admin page, do validation of:

if Session("AdminLogin")=TRUE then
   'show your shared page
end if

3. in an area to show client page, do validation of:

if Session("Login")=TRUE then
   'show your shared page
end if
Avatar of Graeme McGilvray

ASKER

Hi Ryan and thanks for that

unfortunately it isn't as simple as that...

its all the same IF statment on the same page (eg customer.asp)

eg.
shared pages is bookings and quotes
admin page show all accounting
client page shows client side accounting

hope this makes sense
yes, the "content" of pages can be different but the "identity" of user could always be the same regardless of where currently the page is.
Sorry I prob missed a bit of explaining

of the page that I am using, there is 6 sections of it that react differently depending on the session active, that is the reason why I need it in 1 IF statement

Cheers
ASKER CERTIFIED SOLUTION
Avatar of Graeme McGilvray
Graeme McGilvray
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I've requested that this question be closed as follows:

Accepted answer: 0 points for G-Money79's comment #a41551544

for the following reason:

Solved it myself
I think what your proposed as the answer is same as what I explained in my previous comment: ID: 41551202
No it isnt unfortunately

you proposed all 3 IF statements are separate, where as mine has the initial (AdminLogin & Login) IF statement as the parent and the others live underneath it..

With yours, the session will stop at the first and not continue onto the rest (as i have tested it)
nvm, good luck cheers
as stated above