Hi Everybody,

  In my somename.cgi file there are few hidden fields like this with the <form> tag:

  <form action="somename.php" method="post">
    <input type="text" name="somename" size="15"><br>
    <input type="submit">
    <input type="hidden" name="order" value="somevalue1">
    <input type="hidden" name="order" value="somevalue2">
  </form>

  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 :

<form action="somename.cgi" method="post">
    <input type="radio" name="somename" value="somevalue">
    <input type="submit">
    <input type="hidden" name="order" value="somevalue1">
    <input type="hidden" name="order" value="somevalue2">
</form>

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 "<input type=hidden name=\"order\" value=\"$line\"> 
\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<input type=\"hidden\" name=\"order\" value=\"" . 
urldecode($ordervalue) . "\">\n";
          }
        } 
==========

  Looking forward for your response.

  Regards,

karthikeyan.

Reply via email to