sending hidden values

From: Date: Mon, 23 Sep 2002 10:30:53 +0000
Subject: sending hidden values
Groups: php.db 
Request: Send a blank email to php-db+get-21926@lists.php.net to get a copy of this message
hi all, in my php script im using <SELECT> in <FORM> element. the <OPTION> values for <SELECT> tag are coming from database. and the situation in my code is that, those values i need to pass as a hidden value thru form. im doing it as, <FORM method="post" action="act_modify.php"> . . . <SELECT NAME="item_v"> // some stuff before this to build query <?
     $result = mysql_query($query) or die ("SELECT failed.");
     while ($list = mysql_fetch_array($result))
     {
        print('<INPUT type ="hidden" name=item_array[] value=' ".$list[item_id]." '>');
       echo '
       <OPTION>
               $list[item_id]
       </OPTION> ';
      }
      echo '</SELECT> ';
?> . . . </FORM> <SELECT> works fine without the "<input type=hidden>" stuff. but when i use print('<INPUT type ="hidden" name=item_array[] value=' ".$list[item_id]." '>'); statement in betn <select> </select> tags, it doesn't print the values betn <option> </option> tag in list box, (ie $list[item_id]) instead it prints one empty list box and $list[item_id] value beside that box. can any one suggest some other possible way to do this? thanks in advance. smita. _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com

« previous php.db (#21926) next »