Quote:
|
Originally Posted by grayfox
Hi everybody,
I want to make a login page in perl, that checks the username and password
and then redirects the person (user) to a page after a succesfull login.
If the username and/or password is not correct an error page will open.
I want to use a database to store the username and password (Oracle, MysQL) or in a simple text file.
I have a problem, I don't know how to start. Can someone help me.
|
1. Create a very basic form for entering username and password.
2. Check if a username and password has been supplied to the script.
3. If no username or no password, print out the above form and exit.
4. If a username and password are sent:
a. Read a list of users from the file (for simplicity we'll say a text file, one user per line)
b. Check if the username and password combo match any of the above.
5. If the username and password are correct, redirect to the appropriate page, otherwise print an error message and exit.
The above is a very simple set of steps for what you are wishing to accomplish, it should get you thinking and give you somewhere to start. If you get stuck with the code, post what you have and I'll try and give you a few pointers.