PDA

View Full Version : password authentication


jlee2301
July 23rd, 2004, 03:04 PM
Hi

I have a page with a form that asks the user to input a user id and password. On the action element of the form I have set it to go to another page - a php page. This page has the info to connect to a database but I dont know how to check the database for the correct user id and password. I have used sql statements to select info from the database but how do you actually compare what has been entered in a form to the entries in a database and then if it is correct, open another webpage - basically its a login to a members only area of a website. Could really do with some help here - thanks.

Jim

degsy
July 23rd, 2004, 04:37 PM
You just need to compare the supplied user & pass with the data in the database.

You can do this using the SELECT statement.

Here is a tutorials on PHP Authentication, but it is basically the same idea
http://www.zend.com/zend/tut/authentication.php#Heading11



How far have you got?
DO you have the database, tables and fields setup?

jlee2301
July 23rd, 2004, 06:37 PM
Thanks - will have a look at the tutorial.
As for how far I have got - I have set up the database table called members with fields MemberID, FName, LName, Password. I want it to check the MemberID and Password then if correct welcome them by first name to the area - or something like that!