Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form data error checking problem...

Status
Not open for further replies.

admoore

IS-IT--Management
May 17, 2002
224
US
I have a form that hands data to a php file for the purpose of writing a transaction to a mysql database- The problem is fixing the user-entered data from the form, specifically:

numeric amounts representing dollars and cents are entered into a form...

1000 entered works fine...
1000.10 entered works fine
1,000.1 causes an improper value


how can I easily handle the various formats a user might enter reliably???

TIA,

-Allen M.
 
try using str_replace to get rid of commas. this would not then support the number type 1.000,00 which is common in europe.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top