Note that there are some explanatory texts on larger screens.

plurals
  1. POpost value's text field OrderForm
    primarykey
    data
    text
    <p>I have multiple books that people can order. All those books are stored in a MySQL database. People can enter value's (INT) into a textfield. Example: Book One value = [5]. But when I enter submit it will only show the last entered value of that textfield.</p> <p>How can I arrange, that if people only enter value's in some textfields and then hit submit they see what product they ordered and the value with it. Thanks :)</p> <p>My code</p> <pre><code> &lt;table width="990"&gt; &lt;form name="form" action="&lt;?php $_SERVER['PHP_SELF']; ?&gt;" method="post"&gt; &lt;tr&gt; &lt;td width="93" class="main"&gt;Bestelnummer&lt;/td&gt; &lt;td width="550" class="main"&gt;Titel&lt;/td&gt; &lt;td width="100" class="main"&gt;Categorie&lt;/td&gt; &lt;td width="150" class="main"&gt;Type Onderwijs&lt;/td&gt; &lt;td width="80" class="main"&gt;Groep&lt;/td&gt; &lt;td width="50" class="main"&gt;Prijs&lt;/td&gt; &lt;td width="40" class="main"&gt;Aantal&lt;/td&gt; &lt;/tr&gt; &lt;?php // Laat Resultaten zien $s = "SELECT * FROM producten ORDER BY id ASC"; $sql = (mysql_query($s))or die ("FOUT: " . mysql_error()); while($row = mysql_fetch_array($sql)) { $id = $row['id']; echo "&lt;tr&gt;"; echo "&lt;td width='93'&gt;" .$row['bestelnummer']. "&lt;/td&gt;"; echo "&lt;td width='550'&gt;&lt;a href='".$row['link']."' target='_blank' title='".$row['titel']."' &gt;" .$row['titel']. "&lt;/a&gt;&lt;/td&gt;"; echo "&lt;td width='100'&gt;" .$row['categorie']. "&lt;/td&gt;"; if ($row['onderwijs'] == "BO") { echo "&lt;td width='150'&gt;Basis Onderwijs&lt;/td&gt;"; } elseif ($row['onderwijs'] == "VO") { echo "&lt;td width='150'&gt;Voortgezet Onderwijs&lt;/td&gt;"; } else { } echo "&lt;td width='80'&gt;" . $row['groep'] . "&lt;/td&gt;"; if ($row['prijs'] == 0) { echo "&lt;td width='50'&gt;&lt;i&gt;gratis&lt;/i&gt;&lt;/td&gt;"; } else { echo "&lt;td width='50'&gt;&amp;euro; " .$row['prijs']. "&lt;/td&gt;"; } echo "&lt;td width='40'&gt;&lt;input type='text' name='nummer".$id."' title='nummer".$id."' class='aantal' maxlength='4' /&gt;&lt;/td&gt;"; echo "&lt;/tr&gt;"; } ?&gt; &lt;tr&gt; &lt;td&gt;&lt;input type="submit" name="submit" value="Plaats bestelling" class="verzend"/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/form&gt; &lt;/table&gt; &lt;?php if (isset($_POST['submit'])) { if (empty($_POST['aantal'])) { echo "L33g"; } else { $_POST['nummer".$id."']; } }?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload