|  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: ukiseal at hotmail dot com
New email:
PHP Version: OS:


 [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-2024 The PHP Group
All rights reserved.
Last updated: Fri Jul 12 21:01:30 2024 UTC