convert form input into integer
Posted: Tue Sep 13, 2005 8:44 am
I have an input textfield in my html form.
When submitted, the contents of that field should be made an integer.
(The input field allows for 11 characters, so I had to use bigInt in MySql.)
doing:
creates an wrong integer.
What should I do? I think it has something to do with the 11 character length of the value inputted.
Everything below 11 characters is converted without any problem by the above method.
But as soon as I try to convert an 11 character value it fails.
Any idea?
When submitted, the contents of that field should be made an integer.
(The input field allows for 11 characters, so I had to use bigInt in MySql.)
doing:
Code: Select all
(int)$_POST['number'];What should I do? I think it has something to do with the 11 character length of the value inputted.
Everything below 11 characters is converted without any problem by the above method.
But as soon as I try to convert an 11 character value it fails.
Any idea?