Re: Parse POST-Data myself

From: Date: Fri, 16 Nov 2001 15:17:34 +0000
Subject: Re: Parse POST-Data myself
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-74884@lists.php.net to get a copy of this message
take the query string as is: $QUERY_STRING in this case: $qstring = "myfield1=aaaaaaaa&myfield2=aaaccc&myfield1=33333333"; and then pass it on as is again to whoever you want! or you can parse it like: $qstrings = split('&', $qstring); then split each pair: $pairN = split('=', $qstrings[$i]); etc.... "Stefan" <s.rusterholz@interaktion.ch> wrote in message news:002601c16eaf$cb057830$3c01a8c0@quasimodo... Hi I have following problem: I get a form with some fields having the same name. PHP solves this problem by appending [] to the form-field-names which causes the creation of arrays. My problem now is, that I have to pass those variables further to another script (not PHP) in exactly that order I receive them from the form. But when I have a form (schematically) like this: -input type=text name=myfield1 -input type=text name=myfield2 -input type=text name=myfield1 -input type=text name=myfield2 -input type=text name=myfield1 -input type=text name=myfield2 Then I get in PHP all myfield1 in 1 variable (the array myfield1) and all myfield2 in 1 other variable -> order is irreversibly destroyed. Give the fields numbers is not a solution (for complexity reasons). So my ultima ratio is to parse the post-data myself - but how can I do this? I have not found any indices for a variable containing post-data :-( If someone has another approach to a solution: I will have both ears open for it :) Thanks in advance Stefan Rusterholz, s.rusterholz@interaktion.ch ---------------------------------- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich ---------------------------------- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch ----------------------------------

« previous php.general (#74884) next »