Forums

ASP

This topic is locked

redirect client to client page and admin to admin

Posted 28 Feb 2003 11:23:43
1
has voted
28 Feb 2003 11:23:43 Adam Davies posted:
Hi there,
probabyl an easy question but I have created a login for my site using dmx and asp vbscript but what I want to do is if someone logs in and their user level is 1 they get sent to the admin section (admin/admin.php) but if their user level is 2 they get re-directed to the client section (client/welcome.asp)

Replies

Replied 28 Feb 2003 22:16:43
28 Feb 2003 22:16:43 Jørgen Emerslund replied:
OK, if you need to be able edit user levels easily, probably the easiest is to include a number field in you db (Access?). If you only want to be redirected yourself to the admin-page, you could just check for the right username, I guess...

<%
If rsRec("level" = 1 Then Response.Redirect("admin/admin.php"
If rsRec("level" = 2 Then Response.Redirect("client/welcome.php"
%>

Or....

<%
If rsRec("username" = "admin" Then Response.Redirect("admin/admin.php"
Response.Redirect("client/welcome.php"
%>

In the last case, you will be redirectd to the admin-area before you get to the next line... Anyways, it needs a little adapting, but you should get the basic idea!

Good luck!

Reply to this topic