SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Threaded View

  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2004
    0 Post(s)
    0 Thread(s)

    Question 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"><!-- = (Math.round(altersecure(totalcost)));

    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.

    Last edited by Northernladuk; May 3, 2005 at 19:06.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts