Guest Posted November 22, 2002 Posted November 22, 2002 I am workin on a mod How do you compare information stored in the database with info a user inputs on a form. lets say email_address and order_id the user created an account and made a purchase so the above info is in the database already. I created a form that allows them to enter that information again, when thay submit that form I want the code to compare what they entered to what is in the database and then direct them to another page or tell them that the information is incorrect or does not exist, try again. Thanks Quote
mattice Posted November 22, 2002 Posted November 22, 2002 Create a form that has values like $form_whatever. That form's action posts to another script that gets the information from the database, ie $db_whatever. Then you compare them: (pseudo code) if ($form_whatever != $db_whatever) { //do stuff, there is no match } or use == (double "=" is correct) which means they do match. Quote "Politics is the art of preventing people from taking part in affairs which properly concern them"
Guest Posted November 22, 2002 Posted November 22, 2002 when you say create a form that action posts to another script do you mean another page that contains that script like a process page or post to a script within the same page and put the results on a new page or the same page?? If you have or know of something similar can you post an example script? Thanks again, I really appriciate the help. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.