Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

verify orders


Guest

Recommended Posts

i would like to setup a "contact form" that asks the user their order number. before submitting the form, the script would check the database to ensure their order id is valid, if it isn't... they get an error and the form is not submitted.

 

anyone have an idea of how i could achieve this?

i am using a basic php contact form, the only thing i cannot figure out, is how to check the database before submitting the form

Link to comment
Share on other sites

i would like to setup a "contact form" that asks the user their order number. before submitting the form, the script would check the database to ensure their order id is valid, if it isn't... they get an error and the form is not submitted.

 

anyone have an idea of how i could achieve this?

i am using a basic php contact form, the only thing i cannot figure out, is how to check the database before submitting the form

 

As far as i know you will not be able to check the database before the form is submitted as to query the database you need the info from the form.

 

submit your form,

get the submitted order id

check database for validity

if valid....

if not valid... return them to form (or what ever your requirement is)

Its Only Me

Alex

Link to comment
Share on other sites

since i am using a simple php contact form, couldn't i somehow insert the database query into the script? i do not know php very well, so i'm stumped at what i would need to do in order to get that to work

Link to comment
Share on other sites

Look at the create_account.php file and the error checking it does when a user creates an account. Then setup your contact form to work like that. In particular look at the part of create_account.php that checks for an existing e-mail address.

 

If you really wanted to be creative and understand PHP/mySQL/JavaScript you could create an AJAX solution. Search Google for AJAX and you can what I am talking about.

 

The easiest solution though would be to do the first suggestion above.

 

Hope that helps.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...