So if they entered a code in the text box "promocode" and they need to enter the word "sale" for the promo code to equal a 5 dollar discount. Then if they enter the correct promo code "sale" into the text box, I need a variable like $discount=5, so:
Code:
if($promocode == sale) {
$discount=5
} else {
$discount=0
}
Would that work?
Then in my php form I could have something like:
Code:
$total=$subtotal-$discount
to display the total minus the discount.
thanks!
Got it figured out, thanks for the help!!
Last edited by virtualgeorge; 10-06-2010 at 10:56 PM..
|