laserlight;10935169 wrote:Read the PHP manual on [man]intval/man. Personally, I would just cast to int.
That depends on the range of int in your database.
It sounds like you want to store it as a string, not an int, but just validate that it consists of digits (which can be done with [man]ctype_digit/man).
Yup, thanks now I know. By the way buddy, I have this script now this time I want to check if my SESSION variables did pass on my multi-page form. I created a script that will print all of them. Is my syntax correct?
echo "$_SESSION['username']" . "$_SESSION['password']" . "$_SESSION['emailadd']" . "$firstname" . "$midname" . "$lastname" . "$city_add" . "$city_mobile" . "$citizenship" . "$gender" . "$religion" . "$cstatus" . "$mbday" . "$dbday" . "$ybday";
I'm having an error here in this line as my browser pinpoints:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\xampp\htdocs\pamscorp\form2_processing.php on line 47