Here's the situation:
I have a simple HTML form that passes user-inputted data to a PHP script for processing. The HTML form consists of the typical <input type=text> fields. One of the fields within that HTML page asks the user for a numerical value. On the PHP script, I want to check to see if the user inputted numbers (integer) into the field. When I do a gettype() check on the variable $year (passed from the HTML form), the result is "string", even if the value entered into the field was a number like 1999. Thus, I cannot validate whether or not the data inputted is a string or an integer.
I know I can convert the submitted data by forcing it to become an integer by using settype(), but is there any reason why all data submitted via web forms are strings?
Any ideas would be of a big help!
Thanks.