Foreach Skipping #1

I have this script that reads in the dynamic textbox values and it works great EXCEPT it skips the value in the first textbox and in doing so enters all data one less in the database. Any suggestions as to why my script missed the 1st value?


foreach($_POST['filetitle'] as $value)
{   
$filetitle[] = $value;
}

This is coming from the form and how it’s setup to send the array of 10 textboxes.


for($i=1; $i<=$max_no_img; $i++){
echo "<tr><td><b>Image $i</b><br/ >
<input type=file name='images[]' class='bginput'><td><b>Image Title</b><br />
<input type=text name='filetitle[]' size='40'></td></tr>
<tr><td colspan='2'><b>Image Description</b><br />
<textarea cols='80' rows='5' name='filedesc[]'></textarea>
</td>
</tr>";
}

The part for the image works great and I’m using the same foreach loop for the filedesc as well and it misses because its the same setup.

Change the 1 to a 0 as arrays always start at 0

DUH! Appreciate getting me straight. Sorry it was such a dumb question, easy miss though.

No worries