Applying more than one password to a form
Posted: Mon Jul 14, 2008 2:34 am
Hi,
I’m looking for some pointers as to how to setup the following. I have a single form field that I’m using as a type of discount so that when a code(password) is entered a specific total is taken off a price. My problem is that I want to be able to have a couple of discounts available so that more than one can be entered at a time.
So the table in my database would have fields that contain a few unique codes - for example:
Discount value $20 - code 12345
Discount value $30 - code 54321
I know how to run a loop looking for a specific code but I need to set this up so that if the first code is entered the value is taken off and then if the second code is entered then that is also taken off and so on.
For the moment I just want to get the logic of how to enter a code into the form print (echo) this out on another page and then add the second code and see this along with the first code on the same page. Should I be using Sessions?
If anyone can give me a few pointers as to how to go about this I’d be very grateful.
I’m looking for some pointers as to how to setup the following. I have a single form field that I’m using as a type of discount so that when a code(password) is entered a specific total is taken off a price. My problem is that I want to be able to have a couple of discounts available so that more than one can be entered at a time.
So the table in my database would have fields that contain a few unique codes - for example:
Discount value $20 - code 12345
Discount value $30 - code 54321
I know how to run a loop looking for a specific code but I need to set this up so that if the first code is entered the value is taken off and then if the second code is entered then that is also taken off and so on.
For the moment I just want to get the logic of how to enter a code into the form print (echo) this out on another page and then add the second code and see this along with the first code on the same page. Should I be using Sessions?
If anyone can give me a few pointers as to how to go about this I’d be very grateful.