Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

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

Posted

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.

"Politics is the art of preventing people from taking part in affairs which properly concern them"

Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...