La cuestión es que no se como decirle que si una foto no existe no hacer el proceso.
Este es mi formulario:
Código HTML:
Ver original
<form action="fotos_cargadas.php" name="form2" enctype="multipart/form-data" id="form2" method="post" >
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
<td>
<input type="file" name="foto1" id="foto1" />
</td>
</tr>
<tr>
<td>
<input type="file" name="foto2" id="foto2" />
</td>
</tr>
<tr>
<td>
<input type="file" name="foto3" id="foto3" />
</td>
</tr>
<tr>
<td>
<input type="file" name="foto4" id="foto4" />
</td>
</tr>
<tr>
<td>
<input type="file" name="foto5" id="foto5" />
</td>
</tr>
<tr>
<td>
<input type="file" name="foto6" id="foto6" />
</td>
</tr>
<tr>
<td>
<input type="file" name="foto7" id="foto7" />
</td>
</tr>
<tr>
<td>
<input type="file" name="foto8" id="foto8" />
</td>
<tr>
</tr>
</tr>
</form>
y aqui las recibo:
Código PHP:
Ver original
require_once '../../func/ResizePicture.php';
$foto_nombre = $_POST['codigo'];
$numero1 = '1';
$numero2 = '2';
$numero3 = '3';
$numero4 = '4';
$numero5 = '5';
$numero6 = '6';
$numero7 = '7';
$numero8 = '8';
$ruta1 = "../../images/galeria/large/";
$ruta2 = "../../images/galeria/thumbnails/";
$extension = "jpg";
$image = new ResizePicture($_FILES['foto1']['tmp_name']);
$image->resize(444,420);
$w444 = $foto_nombre. '_' .$numero1. '.' . $extension;
$image->save($ruta1.$w444);
$image->resize(54,54);
$w54 = $foto_nombre. '_' .$numero1. '.' . $extension;
$image->save($ruta2.$w54);
$image = new ResizePicture($_FILES['foto2']['tmp_name']);
$image->resize(444,420);
$w444 = $foto_nombre. '_' .$numero2. '.' . $extension;
$image->save($ruta1.$w444);
$image->resize(54,54);
$w54 = $foto_nombre. '_' .$numero2. '.' . $extension;
$image->save($ruta2.$w54);
$image = new ResizePicture($_FILES['foto3']['tmp_name']);
$image->resize(444,420);
$w444 = $foto_nombre. '_' .$numero3. '.' . $extension;
$image->save($ruta1.$w444);
$image->resize(54,54);
$w54 = $foto_nombre. '_' .$numero3. '.' . $extension;
$image->save($ruta2.$w54);
$image = new ResizePicture($_FILES['foto4']['tmp_name']);
$image->resize(444,420);
$w444 = $foto_nombre. '_' .$numero4. '.' . $extension;
$image->save($ruta1.$w444);
$image->resize(54,54);
$w54 = $foto_nombre. '_' .$numero4. '.' . $extension;
$image->save($ruta2.$w54);
$image = new ResizePicture($_FILES['foto5']['tmp_name']);
$image->resize(444,420);
$w444 = $foto_nombre. '_' .$numero5. '.' . $extension;
$image->save($ruta1.$w444);
$image->resize(54,54);
$w54 = $foto_nombre. '_' .$numero5. '.' . $extension;
$image->save($ruta2.$w54);
$image = new ResizePicture($_FILES['foto6']['tmp_name']);
$image->resize(444,420);
$w444 = $foto_nombre. '_' .$numero6. '.' . $extension;
$image->save($ruta1.$w444);
$image->resize(54,54);
$w54 = $foto_nombre. '_' .$numero6. '.' . $extension;
$image->save($ruta2.$w54);
$image = new ResizePicture($_FILES['foto7']['tmp_name']);
$image->resize(444,420);
$w444 = $foto_nombre. '_' .$numero7. '.' . $extension;
$image->save($ruta1.$w444);
$image->resize(54,54);
$w54 = $foto_nombre. '_' .$numero7. '.' . $extension;
$image->save($ruta2.$w54);
$image = new ResizePicture($_FILES['foto8']['tmp_name']);
$image->resize(444,420);
$w444 = $foto_nombre. '_' .$numero8. '.' . $extension;
$image->save($ruta1.$w444);
$image->resize(54,54);
$w54 = $foto_nombre. '_' .$numero8. '.' . $extension;
$image->save($ruta2.$w54);
Por favor orientenme un poco.... Gracias
 
 

 
 

