Auto group page-redirect
Hi, i have an access group, with a username and password login. I would like, if the user is in lets say an Staff access group then it will only show links which is avaible for staff only or it tranfers them to a new page only for the there access group. Can that be done.
E.g
Username Group Password
Darren Staff 123890
Bob Tech 123890
Staff will load up stafwelcome.asp
Tech will load up techwelcome.asp
It is only a few links which i have on a page which i dont want some users to see. for example if i dont want them to see the create new user hyper link.
Thanks
Suzanne posted this at 15:35 — 26th January 2004.
She has: 5,507 posts
Joined: Feb 2000
Sure that can be done.
Set session variables and use conditional includes based on those session variables.
Edit: oh, I don't know if asp has session variables? It must, though.
dhotchin posted this at 15:38 — 26th January 2004.
He has: 183 posts
Joined: Nov 2003
It does, but not 100% on how to set it up, but if that is the way, then i will try it out. thanks for the quick response
Mark Hensler posted this at 21:15 — 26th January 2004.
He has: 4,048 posts
Joined: Aug 2000
ASP has a Session object...
'login.asp
If Request("txtUser") = "staff" And Request("txtPass") = "secret" Then
Session("IsStaff") = True
Response.Redirect "staffwelcome.asp"
EndIf
If Request("txtUser") = "staff" And Request("txtPass") = "secret" Then
Session("IsTech") = True
Response.Redirect "techwelcome.asp"
EndIf
Session("IsStaff") = False
Session("IsTech") = False
Response.Redirect "guestwelcome.asp"
'staffwelcome.asp
If Session("IsStaff") = False Then
'quit hacking!
Response.Redirect "login.asp"
EndIf
Mark Hensler
If there is no answer on Google, then there is no question.
dhotchin posted this at 08:16 — 29th January 2004.
He has: 183 posts
Joined: Nov 2003
Hi, thanks for that Mark. It work a treat. Just to let you no, the above code does not show up on Mac OS X on IE. Lucky that i have a PC along side me.
Renegade posted this at 19:09 — 29th January 2004.
He has: 3,022 posts
Joined: Oct 2002
heh, I was about to say that...
Mark Hensler posted this at 19:08 — 29th January 2004.
He has: 4,048 posts
Joined: Aug 2000
Really?! That's the default vB template for the code tag. How could they have missed that?!!
dhotchin posted this at 09:22 — 30th January 2004.
He has: 183 posts
Joined: Nov 2003
Hi, i have not really study ASP. I have only learnt using Dreamweaver. So it does that coding in the background. I have learnt the main errors which could could happen and how to fix them. Just not another sort of coding. So i'm learning all the time.
Suzanne posted this at 19:18 — 29th January 2004.
She has: 5,507 posts
Joined: Feb 2000
shows up fine in Safari.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.