Hi, I want to loop a form name. Incrementing it so that each field has the same input name with a number.
It just isn't working, I am new to php so really need some help!
It just isn't working, I am new to php so really need some help!
Code:
<?php
for ($cnt=1; $cnt<=; $i++)
{
echo "$cnt";
}
?>
<tr> <td> <?php do { ?>
<input name="day<?php echo $cnt; ?>" value="<?php echo $row_days['day_name']; ?>">
</td>
<td> <input name="mail_drop<?php echo $cnt; ?>" type="text" id="mail_drop" value="" size="10"></td>
<td><input name="phone_canvas<?php echo $cnt; ?>" type="text" id="phone_canvas" size="10" value=""> </td>
<td><input name="emails_sent<?php echo $cnt; ?>" type="text" id="emails_sent" size="10" value=""></td>
<td><input name="appointments_made<?php echo $cnt; ?>" type="text" id="appointments_made" size="10" value=""></td>
<td><input name="presentations<?php echo $cnt; ?>" type="text" id="presentations" size="10" value=""></td>
<td><input name="bills_analysed<?php echo $cnt; ?>" type="text" id="bills_analysed" size="10" value=""></td>
<td><input name="orders<?php echo $cnt; ?>" type="text" id="orders" size="10" value=""></td>
<td><input name="deliveries<?php echo $cnt; ?>" type="text" id="deliveries" size="10" value=""></td>
<td><input name="referrals<?php echo $cnt; ?>" type="text" id="referrals" size="10" value=""></td>
<?php } while ($row_days = mysql_fetch_assoc($days)); ?>
</tr>