RE: [PHP] FORM RELATED QUESTION - I
Append '[]' to the field name, e.g., order[] = 10 order[] = 20 Then process the submitted field as an array. Kirk > -Original Message- > From: karthikeyan [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 05, 2002 9:18 AM > To: Jason Wong > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] FORM RELATED QUESTION - I > > > Yes I did use $HTTP_POST_VARS but it removes duplicate > values. Say if > there are two hidden variables > > 1. order= 10 > 2. order= 20 > > I get order=20 the last one but i want both. I need both. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FORM RELATED QUESTION - I
Yes I did use $HTTP_POST_VARS but it removes duplicate values. Say if there are two hidden variables 1. order= 10 2. order= 20 I get order=20 the last one but i want both. I need both. Regards, karthikeyan. - Original Message - From: Jason Wong <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, March 05, 2002 9:18 AM Subject: Re: [PHP] FORM RELATED QUESTION - I > > On Tuesday 05 March 2002 10:39, karthikeyan wrote: > > > how do i accomplish the same in php. > > > > I have one solution using GET method but I would really like to have it > > in POST because I am passing lots of values to this php file. > > > > == > > $ar=explode('&',$QUERY_STRING); > > > > foreach ($ar as $stritem) { > > if(substr($stritem, 0, 5) == "order") { > > $ordervalue = substr($stritem, 6); > > echo "\n > urldecode($ordervalue) . "\">\n"; } > > } > > == > > I don't fully understand your question and what your problem is. Taking a > stab in the dark, did you want to retrieve the values resulting from a POST? > > If so then use: > > $HTTP_POST_VARS (php <= 4.06) > $_POST (php > 4.06) > > > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > > /* > Small things make base men proud. > -- William Shakespeare, "Henry VI" > */ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FORM RELATED QUESTION - I
On Tuesday 05 March 2002 10:39, karthikeyan wrote: > how do i accomplish the same in php. > > I have one solution using GET method but I would really like to have it > in POST because I am passing lots of values to this php file. > > == > $ar=explode('&',$QUERY_STRING); > > foreach ($ar as $stritem) { > if(substr($stritem, 0, 5) == "order") { > $ordervalue = substr($stritem, 6); > echo "\n urldecode($ordervalue) . "\">\n"; } > } > == I don't fully understand your question and what your problem is. Taking a stab in the dark, did you want to retrieve the values resulting from a POST? If so then use: $HTTP_POST_VARS (php <= 4.06) $_POST (php > 4.06) -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk /* Small things make base men proud. -- William Shakespeare, "Henry VI" */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FORM RELATED QUESTION - I
Hi Everybody, In my somename.cgi file there are few hidden fields like this with the tag: Now in my php file (somename.php) i somehow need to get that hidden name and value and put it inside my php form like this : Note : I cannot change the name of the hidden variable order into an array like order[] or something like that because that variable is being used by some cgi program so I want to maintain the name as it is. I have a CGI-Perl code which does job very easily like this : *** foreach $line (@orders) {print " \n"} *** how do i accomplish the same in php. I have one solution using GET method but I would really like to have it in POST because I am passing lots of values to this php file. == $ar=explode('&',$QUERY_STRING); foreach ($ar as $stritem) { if(substr($stritem, 0, 5) == "order") { $ordervalue = substr($stritem, 6); echo "\n\n"; } } == Looking forward for your response. Regards, karthikeyan.