I need a help about this i have a log in form design

Username
Password

And my database table

Username
Password
Usertype

I want that if admin will login admin form will show. While if employee will log in emlpoyee form will show.

How to do that in code. Im using sql server

Recommended Answers

All 2 Replies

Let's start with covering a problem I see all too often in new designs. Ready?

NEVER STORE PASSWORDS IN A DATABASE.

So beyond your database schema you show your login with password and then encrypt and salt the user supplie password then compare that to the password in the database which is also encrypted and salted. At no time do you store the plain password. This way you never expose or know the password for reasons in the search above.

Now about your other question. Once you get the login and verify you show the page you want based on usertype.

In psuedocode it's If usertype == "God" then show GodPage eles show MereMotalPage.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.