Jump to content

Undefined index


bravo14

Recommended Posts

Hi guys

 

I am getting an error of

Notice: Undefined index: photo_filename in /home/sites/haldonguesthouse.co.uk/public_html/new-site/admin/upload.php on line 28

 

I understand that the error would suggest that the field is not referenced on the form that is used to post the values through.

 

Below is the form code that is used to post the values

<form id="add_gallery" action="upload.php" method="post">
<table>
<tr>
<td>Gallery Name</td>
<td><select name="category" id="category">
<option>Please select...</option>
<option value="14">Superior Double Room</option><option value="15">Superior Single Room</option><option value="16">Double en-suite</option><option value="17">Twin or Triple Room, en suite</option><option value="18">Family Room for 4</option><option value="19">Single Room with Private Facilities</option><option value="20">Double Room with Private Facilities</option><option value="21">The Gallery</option></select></td>
</tr>
<tr>
<td>
     Photo 1:
    <input name='photo_filename[]' type='file' />
</td>
</tr>
<tr>
<td>
     Title:
    <input name='photo_caption[]' type="text" size="30">
</td>
</tr><tr>
<td>
     Photo 2:
    <input name='photo_filename[]' type='file' />
</td>
</tr>
<tr>
<td>
     Title:
    <input name='photo_caption[]' type="text" size="30">
</td>
</tr><tr>
<td>
     Photo 3:
    <input name='photo_filename[]' type='file' />
</td>
</tr>
<tr>
<td>
     Title:
    <input name='photo_caption[]' type="text" size="30">
</td>
</tr><tr>
<td>
     Photo 4:
    <input name='photo_filename[]' type='file' />
</td>
</tr>
<tr>
<td>
     Title:
    <input name='photo_caption[]' type="text" size="30">
</td>
</tr><tr>
<td>
     Photo 5:
    <input name='photo_filename[]' type='file' />
</td>
</tr>
<tr>
<td>
     Title:
    <input name='photo_caption[]' type="text" size="30">
</td>
</tr><tr>
<td>
     Photo 6:
    <input name='photo_filename[]' type='file' />
</td>
</tr>
<tr>
<td>
     Title:
    <input name='photo_caption[]' type="text" size="30">
</td>
</tr><tr>
<td>
     Photo 7:
    <input name='photo_filename[]' type='file' />
</td>
</tr>
<tr>
<td>
     Title:
    <input name='photo_caption[]' type="text" size="30">
</td>
</tr><tr>
<td>
     Photo 8:
    <input name='photo_filename[]' type='file' />
</td>
</tr>
<tr>
<td>
     Title:
    <input name='photo_caption[]' type="text" size="30">
</td>
</tr><tr>
<td>
     Photo 9:
    <input name='photo_filename[]' type='file' />
</td>
</tr>
<tr>
<td>
     Title:
    <input name='photo_caption[]' type="text" size="30">
</td>
</tr><tr>
<td>
     Photo 10:
    <input name='photo_filename[]' type='file' />
</td>
</tr>
<tr>
<td>
     Title:
    <input name='photo_caption[]' type="text" size="30">
</td>
</tr><tr>
<td></td><td><input type="submit" name="submit" value="Upload Photos"/></td>
</tr>
</table>
</form>

Link to comment
https://forums.phpfreaks.com/topic/258045-undefined-index/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.