In the php Code, the following code is used to build a table with format and all 3 cells for text and one cell for image upload.
echo "<table border=1 align=center>
<tr bgcolor='#FFC600'>
<th>sectionID</th>
<th>name</th>
<th>price</th>
<th>image</th>
<th>add</th>
</tr>";
echo "<form action=Data.php enctype=multipart/form-data method=post>";
echo "<tr>";
// give the insert row a special color
echo "<tr bgcolor='#FFC600'>";
echo "<td><input type=text name=cat_id></td>";
echo "<td><input type=text name=item_name></td>";
echo "<td><input type=text name=item_price></td>";
echo "<td><input type=file name=uploaded_file></td>";
echo "<td>" . "<input type=submit name=add value=addNew" . " </td>";
echo "</tr>";
echo "</form>";
echo "</table>";
echo "<br>";
I need to change the input for cat_id to a dropdownlist, i tried to implement this code but had no success.
<select>
<option value="a">aa</option>
<option value="b">bb</option>
<option value="c">cc</option>
<option value="d">dd</option>
</select>
This is what i tried so far: adding the 6 above lines to the code as follows:
echo "<form action=myItemsData.php enctype=multipart/form-data method=post>";
echo "<tr>";
// give the insert row a special color
echo "<tr bgcolor='#FFC600'>";
echo "<td>
<select name=cat_id>
<option value="a">aa</option>
<option value="b">bb</option>
<option value="c">cc</option>
<option value="d">dd</option>
</select>
</td>";
echo "<td><input type=text name=item_name></td>";
echo "<td><input type=text name=item_price></td>";
echo "<td><input type=file name=uploaded_file></td>";
echo "<td>" . "<input type=submit name=add value=addNew" . " </td>";
echo "</tr>";
echo "</form>";
echo "</table>";
echo "<br>";
and i got this back when i tried to load the page on the browser:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.