Jump to content

form data POST to another form


vfragk

Recommended Posts

i have a form with multiple selection fields that comes up from specific table fields of an MYSQL db.

when i'm submitting the form i want to GET the values of the fields and use them as multiple selection fields to another form.

here is my code:

 

test1.php

......

<form id="form1" name="form1" method="post" action="test2.php">

  <?php

          include '../config.php';

          include '../opendb.php';

          $result = mysql_query("SELECT  *  FROM country");

?>

      <label>choose section<br/>

<select name="tmima[]" size="10" multiple="multiple" id="tmima">

    <?  while($row = mysql_fetch_array($result)) {

echo "<option value=\"".$row ['OT'] . "\"> " . $row ['OT'] .  "</option>  "; }?>

</select> <br/> </label>

      <? include '../closedb.php';  ?>

  <input type="reset" name="button2" id="button2" value="reset" />

      <input type="submit" name="button" id="button" value="submit" />

      </label><br/></form>

.....

test2.php

....

 

<? $tmima = $_GET['tmima']; ?>

....

<form id="form2" name="form2" method="post" action="test3.php">

<label>choose name<br/>

<select name="tm[]" size="10" multiple="multiple" id="tm">

        <?  $tmima=$_POST['tmima'];

  if ($tmima){

foreach ($tmima as $t){ echo "<option value=\"".$t . "\"> " . $t . "</option>  ";}} ?>

</select> <br/></label>

  <input type="reset" name="button3" id="button3" value="reset" />

  <input type="submit" name="button4" id="button4" value="submit" />

 

</form>

..............

what im doing wrong?isn't it possible to pass values to another page-form?

 

 

Link to comment
https://forums.phpfreaks.com/topic/130336-form-data-post-to-another-form/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.