php.net |  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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
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)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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:
strspn($string,"1234567890.") 
would be a good start.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Sep 28 06:05:53 2022 UTC