Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- send price such as 1000.50 using a form


helenp - 4:54 pm on Jan 16, 2013 (gmt 0)


Hi,
Been searching and trying,
I need to insert a price in a form to later insert into a mysql column wich is decimal(10,2).
The price needs to be like:
1000 or
1000.00 or
1000.50
Instead of 1 inputs wich looks more complicated to me I am trying to uso 2 inputs, wich I then join like this:
$holidaycost = $price.".".$decimal;
then I check the inputs with ctype_digit to check that only numbers where filled in.
It works perfect, however if the second input is left empty then I need to convert the empty field to 0, wich I cant manage.
Any ideas?


Thread source:: http://www.webmasterworld.com/php/4536595.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com