primero el form
Código HTML:
 <body> <form method="post" action="guardar.php" enctype="multipart/form-data"> Nombre: <input type="text" name="nombre" maxlength="100"><br> Imagen: <input type="file" name="imagen[]" size="40"><br> Imagen: <input type="file" name="imagen[]" size="40"><br> Imagen: <input type="file" name="imagen[]" size="40"><br> Imagen: <input type="file" name="imagen[]" size="40"><br> <p><input type="submit" name="submit" value="Subir"> </form>
en esta parte no se que estoy haciendo mal
Código PHP:
  
<body>
<?
$archivo = $_FILES ['imagen']['name'];
$count = count($imagen); 
for($i=0;$i<$count;$i++){ 
 
$ruta = "/home/tacopnet/public_html/pdf/image/".$archivo."";
} 
if(!copy($_FILES[$i]['tmp_name'], $archivo)) { 
echo "error al copiar el archivo"; 
} else { 
echo "archivo subido con exito"; 
mysql_connect("10.33.143.3","tacopnet_root","y+y-u*u/"); 
mysql_select_db("tacopnet_tacop"); 
$nombre = $_POST["nombre"]; 
mysql_query("INSERT INTO imagenes (nombre,ruta) VALUES ('$nombre','$ruta')"); 
} 
?>
</body>    
 




