I have a form that generates using a for() loop. Here is part of the code:
Code: Select all
$result = "one,two,three";
$items = explode(",",$result);
$num = count($items);
echo " <form id=\"form1\" name=\"form1\" method=\"post\" action=\"testform2.php?action=process\">
<table width=\"50%\">";
for ($c=0; $c < $num; $c++)
{echo "
<tr><Name<input type=\"text\" name=\"name$c\" id=\"\" /></td>
<tr>Email<input type=\"text\" name=\"email$c\" id=\"\" /></td>
<tr>City<input type=\"text\" name=\"city$c\" id=\"\" /></td>
name0, email0, city0
name1, email1, city1
name2, email2, city2
When the form is submitted, i need the data to write to my db, where each row in the db will be data from the corresponding keys.
TIA
DD