SitePoint Enthusiast
Problems with amount value from cookie to form
I have shopping cart where the basket is stored as a cookie. On my order page I use the following to get it assigned so that the next page can handle it.
<SCRIPT LANGUAGE="JavaScript"><!--
document.secure.amount.value = (Math.round(altersecure(totalcost)));
//--></SCRIPT>
On the card processing page there is the following statement.
<INPUT TYPE="hidden" NAME="amount" VALUE="$amount">
I take it at this point the value has been extracted from the cookie and passed to the processing page in the same way a form variable would.
So now I am trying to add this to a Mysql database using..
amount=request.form("amount") and doing an insert.
Problem is it just comes out 999.99
The mysql field is a decimal 4,2. If i put it to VARCHAR then the price comes out but withouth the decimal point.
Could anyone point out where I might be going wrong please.
THanks
Last edited by Northernladuk; May 3, 2005 at 19:06 .
SitePoint Enthusiast
Ok, sorry about this, got it now. The altersecure call changes the value, dropped that and it's ok.
Sorry.
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks