Bug #18236 Updated: EXACT HTTP POST data access

From: Date: Tue, 09 Jul 2002 10:53:26 +0000
Subject: Bug #18236 Updated: EXACT HTTP POST data access
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-13587@lists.php.net to get a copy of this message
ID: 18236 Updated by: m.ford@lmu.ac.uk Reported By: foobardotcom@poczta.onet.pl Status: Feedback Bug Type: Feature/Change Request Operating System: Linux cyberhq 2.4.19-pre6 #2 SMP PHP Version: 4.2.1 New Comment: The problem here is not really needing to type the extra two characters, but that the resulting name/id is *not* *in* *conformance* *with* *HTML4.0*, which states that: > ID and NAME tokens must begin with a letter ([A-Za-z]) > and may be followed by any number of letters, digits > ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), > and periods ("."). [http://www.w3.org/TR/html401/types.html#h-6.2] So we either have to write non-conformant HTML (not even permitted at some sites!), or program round it (e.g. by naming form elements foo_1, foo_2... and then searching for them in a loop), which is inefficient. Besides this one, bugs #10502, #15498 and #16195 are all OPEN feature requests for the "automatically convert to array" functionality, so there is a fair level of demand for it. Besides, a language that claims to be "especially suited for Web development" [http://www.php.net/] should not actually prevent the writing of standards-conformant Web pages. I wish I had the spare time to investigate the PHP sources and write a patch for this myself, but I just don't. (I only just find time to read the lists most days, but sometimes I even have to dump 100s of messages unread!) Cheers! Previous Comments: ------------------------------------------------------------------------ [2002-07-09 05:00:29] hholzgra@php.net maybe $HTTP_RAW_POST_DATA is what you are looking for? btw: please define "behave correct on select multiple" what is so bad about specifying that you are going to fill an array? the alternative would be to create arrays if multiple values are set while single selections would still become simple strings as there is no way for PHP to know that it was generated from a <select multiple> so it's just a tradeof: having to type two more characters as element name or taking care that both string and array inputs are supported in the form processing code our approach is obviously the first one ------------------------------------------------------------------------ [2002-07-09 02:54:03] foobardotcom@poczta.onet.pl Hello! Plase, *** excuse my english first *** HTTP request looks like that (everything in single quotes for showing where are whitespaces - as you see, it has last newline character): 'POST /test.php HTTP/1.0 Content-Length: 13 Content-Type: application/x-www-form-urlencoded m=1&m=2&m=3 ' Script looks like that: <?php header("Content-type: text/plain"); echo "got request: `" . get_request_data() . "'"; ?> and script should generate output like that: got request: `POST /test.php HTTP/1.0 Content-Length: 13 Content-Type: application/x-www-form-urlencoded m=1&m=2&m=3 ' I just want to make possible query-string parsing, even if POST method is used, because all people today have to use `arr[]' name in select multiple forms especially for PHP... I want to make possible PHP behave correct on select multiple even if method isn't GET (query string in GET method can be parsed manually). I think, PHP should make access to everything low-level and make possible writting low-level based libraries for people like me - purists :) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18236&edit=1

« previous php.bugs (#13587) next »