I don't have time to rewrite this for you but this is how I would set it up. I would suggest putting all of your mysql calls in a seperate file as such:
INDEX.PHP ///////////////////////////////////////////////
<?
require("global.php");
if ($action == "submit") {
processforminfo($userfile, $menu);
}
?>
<html>
<head>
<title>:: multiple upload ::</title>
<style type="text/css">
<!--
.style1 { color: #FF6600 }
.style2 { font-size: 18px; font-weight: bold; }
-->
</style>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th scope="col"><form name="form1" action="index.php?action=submit" method="post" enctype="multipart/form-data">
<p class="style1 style2">UPLOADING ELEMENTS </p>
<p>
<input name="userfile[0]" type="file" style="width:300;">
<select name="menu[0]">
<option value="menu1"><? echo dropdown("1"); ?></option>
</select>
<br>
<input name="userfile[1]" type="file" style="width:300;">
<select name="menu[1]">
<option value="menu2"><? echo dropdown("2"); ?></option>
</select>
<br>
<input name="userfile[2]" type="file" style="width:300;">
<select name="menu[2]">
<option value="menu3"><? echo dropdown("3"); ?></option>
</select>
<br>
<br>
<input name="Submit" type="submit" id="Submit" value="Upload">
</p>
</form></th>
</tr>
</table>
<p><a href="main.php">home</a></p>
</body>
</html>
GLOBAL.PHP///////////////////////////////////////////////////////////////
<?
// ###################### start database #######################
// ##################### process form info ##################
function processforminfo ($userfile, $menu) {
}
// ##################### drop down ##################
function dropdown ($number) {
}
?>
Hope this gets you on the right track.
-Ptown