|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1425 $HTTP_POST_VARS and $HTTP_GET_VARS get all form values in strings.
Submitted: 1999-05-18 20:29 UTC Modified: 1999-05-18 22:00 UTC
From: ukiseal at hotmail dot com Assigned:
Status: Closed Package: Other
PHP Version: 3.0.7 OS:
Private report: No CVE-ID: None
 [1999-05-18 20:29 UTC] ukiseal at hotmail dot com
I have a simple function which goes through some variables gotten from a form using the $HTTP_POST_VARS and $HTTP_GET_VARS, the function checks if something is an int (is_int()) or string (is_string()), but because $HTTP_POST_VARS and $HTTP_GET_VARS set everything to strings I cant get the results that I need. (I'm trying to make a SQL query which puts quotes around strings and nothing around int's)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1999-05-18 22:00 UTC] rasmus at cvs dot php dot net
Hardly a bug.  That's by design.  What if someone sticks all numbers in a
text field.  Then by your logic you wouldn't put quotes around it and the
SQL database would throw an error.  You need to go by the type of the
field you are putting data into, not by the type of data that you are trying
to put in.

If you really do need to determine the type of the contents of a variable,
there are plenty of functions that let you do that.  Something like:
would be a good start.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Oct 02 16:01:26 2023 UTC