// i did'nt test, but it's the main idea that counts //
<-Form.html->
<form method="post" action="upload.php" enctype="multipart/form-data">
<?
$upload_files="6";
while($x<=$upload_files)
{
<input name="userfile_$x" type="file">
$x++;
}
$x=0;
?>
<input type="submit" value="Upload!!!" >
</form>
<-Upload.php->
<?
if($submit)
{
while($x<=$upload_files)
{
$file_name=stripslashes(${"user".$x."file_name"});
$file_name=ereg_replace(" ","",$file_name);
if($file_name!="none")
{
$file=escapeshellcmd(stripslashes(${"user".$x."file"}));
if(copy($file,$file_name))
{
unlink($file);
$file_db[$x]=$file_name;
}
}
}
}
$host ="host";
$user ="user";
$pass ="pass";
$db ="db";
$conn =mysql_connect($host, $user, $pass)or die("Invalid server or user");
mysql_select_db($db);
#$query = "insert into waterfront values ('".$agent_id."', '".$layout."', '".$page."', '".$position."', '".$text."', '".$address."', '".$city."', '".$state."', '".$zip."', '".$bedrooms."', '".$bathrooms."', '".$price."', '".$mls."', '".$instructions."', '".$userfile_name."', '".$photo2."', '".$photo3."', '".$photo4."', '".$photo5."', '".$photo6."', '".$photo7."', '".$photo8."', '".$photo9."', '".$photo10."')";
$query="insert into waterfront values('$agent_id','$layout','$page','$position','$text.','$address','$city','','$file_db[1]' ";
$result = mysql_query($query);
#if ($result)
$id=mysql_insert_id();
if($id)
{
echo "Server HaD Receive the Upload Files!";
}
?>