Multiple Log in Users

G

Guest

Following article 825498 of creating password protected webpage.
Is it possible for me to create multiple users in one database?
However, the user is only allowed to view their own contents, not other users.


Thank You.
 
D

David Berry

Yes. After you check to see if the user is in the database You can add IF
statements to do that. One way would be to assign the users a UserLevel
number (add a new field in your table). Then in the login.inc file you
could put

If Len(Session("UID")) = 0 then
If UserLevel <> "1" then
Response.Write "You are not authorized to view this page"
end if
end if

If the example above, if the user had an access level of 1 they would be
able to see the page. If not they would get the error. You could do the
same thing with a user name or any other field in the database that
identified the user.

Take a look at http://www.kamath.com/tutorials/tut003_auth.asp for another
way to do this.
 
G

Guest

Thanks.
Does this mean if i have 50 users, i must have 50 user-level in the database?
And how do i link it to their respective "website" of each user?

Thank you very much.
 
T

Thomas A. Rowe

FYI: do not use the file extension ".inc" instead use ".asp", this way the include file content can
not be read if accessed via a browser.

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================
 
D

David Berry

Do you mean each user has their own sub web? If so, you could make another
table that contains the user IDs (autonumber from the first table) and the
sub web names and create a relationship between the 2 tables. Then when the
user logs in you can do a look up, get the sub web name and redirect them to
their sub web
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top