Validating Login / Changing User settings / Php Mysql

Posted by Marcelo on Stack Overflow See other posts from Stack Overflow or by Marcelo
Published on 2010-06-10T02:17:08Z Indexed on 2010/06/10 2:22 UTC
Read the original article Hit count: 264

Filed under:
|
|
|
|

Hi everyone, my questions are about login, and changing already saved data.

(Q1) 'Till now I've only saved input in the tables of the database (registration steps), now I need to check if the input (login steps), are the same of my table in database, in fact I have 3 types of users, then I'll have to check 3 kind of tables. Then if the input data matches with one of those 3 tables I will redirect the user to his specific area.

I'm thinking about saved the submitted data $login=$_REQUEST['login']; and $password=$_REQUEST['password']; and compare with the login column in the database. Then if the login matches, I'll compare the password submitted with the one in the row, not in the column. But I don't know how to do this search and comparison,neither what to use. Then if both matches I'll redirect the user. Else I'll send an login error message. (this I know how to do)

(Q2) What if need to change an already saved user ? For example to change an email address. My changing user's data web page is exactly the same like the registration user web page. Can I load the already saved options and values of registration (table user for example). Then the user will change whatever he thinks it's necessary, and then when he submits the new information, they would not create a new row in my table, but just be overwritten the old information? How can I do this?

Sorry for any mistake in English, and Thanks for the attention.

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql