help with user validation
Posted 05 February 2006 - 06:22 PM
A user comes to the main page of the site. They click on customer to go to a customer-login.php page. This page has username and password on it. When they click submit it goes to a page called loginaction.php. This page validates by cookie the username and password. If those are correct the user is taken to their own page such as customerabc.com. They then fill out an order form, click submit and their order is sent through an email to the company for processing.
The company now wants me to convert the site to mysql for obvious reasons.
on my customer-login.php I have two includes....one is to connect to the database and the other is to login to the database. Both of these work fine. I have one table so far which is called login - it contains the fields username, password, lastLogin, loginId. I set up a page where I pull the data out of those fields and again it works fine. The problem comes when I try to validate that the user that has just entered their information onto the customer-login.php page. I cannot get anything I try to work.
Again, I want the user to enter username and password, these to be validated with the database, and if correct the user will go to their own customer page. What seems like it should be so easy has given me hours of grief. I have used other peoples code snippets as well as writing my own. Can someone please help me accomplish this task where it works? Thank you.....
Posted 05 February 2006 - 09:02 PM
Posted 06 February 2006 - 03:39 AM
I successfully log into the database with my new include files. I have the old username and password login page (from the old pre-database site) but don't know how to convert that to validate the user in my new sql table (called login). The old site then went to a certain page based on that user. I don't know how to do this in php/mysql.
Posted 06 February 2006 - 04:54 AM
Posted 06 February 2006 - 01:26 PM
And yes to the second part. After I validate the user logging in against the database, I have no idea how to send that user to a specific page based on that user (such as customerA.psp or customerB.psp).
Posted 06 February 2006 - 07:57 PM
I'm confused -- a blank page? What did you ask it to do? And you can redirect using PHP's redirect function.
What I am really asking is for is a tutorial (I can't find one) on the following:
A user comes to the site.
They enter a username and password
The username and password is validated against the login table in mysql
The user is taken to their own individual page with custom graphics and such
Posted 06 February 2006 - 09:10 PM
Like I said, you have the user/pass, simple query the users table, and see if you find a matching record or not, and login them in appropriately.
When you say "individual" page, I think you mean a template page that pulls user-specific info from the DB. Again, easily accomplished with PHP, but I can't think of a tutorial off-hand that would serve a good starting point.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users