Problem mit dropdown menü im formular

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • Problem mit dropdown menü im formular

    Hi hab folgendes Problem hab ein Formular erstellt mit einen Textfeld und 2 dropdown menüs aber irgendwie werden die daten der dropdownmenüs nicht übermittel. Hoffe ich könnt mir helfen. Danke im vorraus.

    Code:

    Formular:

    <?php
    include ('connect.php');

    ?>

    <html>
    <body>
    <table border="1" cellpadding="0" cellspacing="0">
    <form action="auswertung.php" method="post">
    <tr>
    <th width="33%"><input name="FA_NR">FA_NR</th>
    <th width="33%">
    <select name="lieferant";>
    <option>

    <?php
    $tb_name="lieferant";
    $sql= "SELECT (Lieferant) from $tb_name";
    $result=mysql_query ($sql, $link);
    for($i=0;$i<mysql_num_rows($result);$i++)
    {
    $ergebnis[$i]=mysql_fetch_array($result);
    }
    for ($i=0; $i<count ($ergebnis);$i++){
    //echo $ergebnis[$i][Lieferant]."<br>";

    echo "<option>".$ergebnis[$i][Lieferant]."</option>";
    }
    ?>

    </option>
    </select>
    </th>
    <th width="34%">
    <select name="kunde">
    <option>

    <?php
    $tb_name="kunden";
    $sql= "SELECT (Kundenname) from $tb_name";
    $result=mysql_query ($sql, $link);
    for($i=0;$i<mysql_num_rows($result);$i++)
    {
    $ergebnis[$i]=mysql_fetch_array($result);
    }
    for ($i=0; $i<count ($ergebnis);$i++){
    //echo $ergebnis[$i][Lieferant]."<br>";

    echo "<option>".$ergebnis[$i][Kundenname]."</option>";
    }
    ?>

    </option>
    </select>
    </th>
    </tr>

    </table>
    <input type="submit" name="submit" value="speichern">

    </form>
    </body>
    </html>



    Auswertung:

    <html>
    <body>
    <table border="1" cellpadding="0" cellspacing="0">
    <tr>
    <th width="100%"><?php echo $_POST[FA_NR]; ?></th>
    </tr>
    <tr>
    <td width="100%"><?php echo $_POST[lieferant]; ?></td>
    </tr>
    <tr>
    <td width="100%"><?php echo $_POST[kunde]; ?></td>
    </tr>
    </table>

    </body>
    </html>[PHP]
    Zuletzt geändert von kraut29; 10.08.2006, 07:39.

  • #2
    Kann mir denn niemand helfen

    Kommentar


    • #3
      weil du deine dynamsichen option-felder in ein statisches option-feld packst?
      PHP-Code:
      <option>
      ...
       echo 
      "<option>".$ergebnis[$i][Lieferant]."</option>";
      ...
      <
      option
      gruß
      peter
      Nukular, das Wort ist N-u-k-u-l-a-r (Homer Simpson)
      Meine Seite

      Kommentar


      • #4
        Super danke das wars. Ich danke dir wie verrückt

        Kommentar

        Lädt...
        X