Hi! I know this is probably an easy question for many of you but I am new to php and was hoping you can help me. I basically have an online form and have a field where the user enters the cost of the product they wish to buy. There is also a 'Discount' check box. If this is checked, the user gets their product at half price. If the check box is checked, when the submit button is pressed I want the discounted cost to be recorded in my database, not the full cost. I was trying to use an equation like this:
Code: Select all
$subtotal = $HTTP_POST_VARSї'cost'] - $HTTP_POST_VARSї'cost'] * $HTTP_POST_VARSї'discount'] * 0.5
Then submit it using the line:
Code: Select all
GetSQLValueString($total, "e;double"e;)
The information is stored in the database fine if I just submit the cost as is entered but when I try to use the code above, the page won't even load when I try to access it. I have looked at many online sources and cannot seem to find an answer that wouldn't require ordering and reading books.
Thanks in advance for any help!