Passing form variables 2 or 3 pages forward
Here is the scene. I have a shopping basket that is cookie driven but on that page I have a discount word form. When you put a correct discount word it kicks this off on the same page and the discount values are calculated in the cookie javascript
Code:
<%Dim search1
If Request.Form("searchstring1") <> "" Then
search1=request.form("searchstring1")
**Database connection stuff here**
set rs=conn.execute("SELECT * FROM discount where discountword = '" & search1 & "'")
If Not rs.EOF Then
Session("DiscountAmount") = rs("discountamount")
Session("DiscountValue") = rs("discountvalue")
Session("Discountword") = rs("discountword")
End If
End If
If Session("DiscountValue") = "" Then Session("DiscountValue") = "1"
If Session("DiscountAmount") = "" Then Session("DiscountAmount") = "0"
%>
You then go to checkout to put your name and address in and pick PAY, your get directed to a secure page to put cc details in. Once you have your order is added to a MySQL database. I need the discount word to appear in the MySQL database as well but this is inserted 2 or 3 pages after the discount word.
In the example about I have (wrongly or rightly) set it is a session variable. How do I use this on the page that is submitting to the MySQL db? As it's a session can I just use a <INPUT TYPE="hidden" NAME=" etc as normal or do I have to do something to jump the variable on across the page?
Please help.