
guardar array de imagenes en mysql
Publicado por alberto (4 intervenciones) el 13/09/2017 05:10:01
Hola gente del foro...aca tratando de realizar algo sin poder lograrlo, (por ahora..jaja),
tengo lo siguiente y quiero guardar ruta de las imagenes en mysql y las imagenes en carpeta pero rezizandolas con este codigo,
y no veo como agregar lo restante de
if(is_uploaded_file, if(is_uploaded_file, etc.
como veran las imagenes las estoy trallendo de una carpeta pero en definitiva seran cargadas desde formulario multiple,,se entiende? gracias a quien pueda echarle una manito, ,,el rezize me funciona bien ,,por si buscaban algo parecido alguien,
tengo lo siguiente y quiero guardar ruta de las imagenes en mysql y las imagenes en carpeta pero rezizandolas con este codigo,
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
$dh = opendir($localDir);
while (false !== ($filename = readdir($dh))) {
$filesArray[] = $filename;
}
// Display and resize
foreach ($filesArray as $images) {
$ext = substr($images, strpos($images, ".")+1, strlen($images));
if( in_array($ext, $AutorisedImageType) ) {
list($width, $height, $type, $attr) = @getimagesize( $localDir.$images );
$xRatio = $maxWidth / $width;
$yRatio = $maxHeight / $height;
if ( ($width <= $maxWidth) && ($height <= $maxHeight) ) {
$newWidth = $width;
$newHeight = $height;
}
else if (($xRatio * $height) < $maxHeight) {
$newHeight = ceil($xRatio * $height);
$newWidth = $maxWidth;
}
else {
$newWidth = ceil($yRatio * $width);
$newHeight = $maxHeight;
}
if($i == $maxCols) {
echo "</tr><tr>";
$i = "";
}
echo " <td align='center' valign='middle' width='$maxWidth' height='$maxHeight'> <img src='".$webDir.$images."' width='$newWidth' height='$newHeight'></td>";
$i++;
}
}
y no veo como agregar lo restante de
if(is_uploaded_file, if(is_uploaded_file, etc.
como veran las imagenes las estoy trallendo de una carpeta pero en definitiva seran cargadas desde formulario multiple,,se entiende? gracias a quien pueda echarle una manito, ,,el rezize me funciona bien ,,por si buscaban algo parecido alguien,
Valora esta pregunta


0