Quiero Saber si A este Upload.php que tengo yo se le puede incrementar algo para que subas las fotos con un logito a a la derecha abajo de la foto.
Este es mi upload.
Código PHP:
<?php include("seguridad.php"); ?>
<?php
ini_set('memory_limit', '64M');
ini_set('upload_max_filesize', '64M');
# DETAILS
$UPLOAD_DIR = $_POST['directorios']; # UPLOAD DIRECTORY
$max_width = '650'; # WIDTH TO RESIZE IMAGES ABOVE IT
$max_height = '500'; # HEIGHT TO RESIZE IMAGES ABOVE IT
# DETECT UPLOAD PRESS
if(isset($_POST['upload'])){
# ADD HERE THE CODE FOR ANY OTHER FIELDS YOU MIGHT HAVE
# GET UPLOADED FILES
$photo = $HTTP_POST_FILES['photo'];
foreach($photo['name'] as $file_id => $file){
# IF FILE IS IMAGE
if($file != NULL && (strstr($file, '.jpg') || strstr($file, '.png') || strstr($file, '.gif'))){
# REPLACE QUOTES
$file = str_replace("'", "`", $file);
$file = str_replace('"', '`', $file);
# COMPOSE URL
$url = $UPLOAD_DIR.'/'.$file;
# COPY FILE TO URL
if(copy($photo['tmp_name'][$file_id],$url)){
# DELETE TMP FILE
unlink($photo['tmp_name'][$file_id]);
# GET IMAGE DETAILS
$data = GetImageSize($url);
$mime = $data['mime'];
# IF IMAGE IS BIGGER THEN MAX VALUES
if (($data[0] > $max_width) or ($height > $max_height)) {
# IF WIDTH IS BIGGER
if ($data[0] > $max_width) {
$width = 50000000000000;
$height = 50000000000000;
}
# IF HEIGHT IS BIGGER AFTER WIDTH BASED RESIZE
if ($height > $max_height) {
$height = $max_height;
$width = $data[0]/($data[1]/$height);
}
# CRATE NEW IMAGE
$frame = ImageCreateTrueColor($width, $height);
# CRATE FILE IMAGE
if ($mime == 'image/gif') {
$im = ImageCreateFromGIF($url);
} else if ($mime == 'image/png') {
$im = ImageCreateFromPNG($url);
} else if ($mime == 'image/jpeg') {
$im = ImageCreateFromJPEG($url);
}
# RESIZE
imagecopyresized ($frame, $im, 0, 0, 0, 0, $width, $height, $data[0], $data[1]);
# WRITE RESIZED IMAGE
imagejpeg($frame,$url,80);
imagedestroy($frame);
imagedestroy($im);
# ADD HERE THE CODE THAT INSERTS DATA INTO A DATABASE IF YOU WISH
# FILE NAME VARIABLE IS $file
}
}
}
}
}
?>
<style type="text/css">
<!--
.Estilo1 {
font-size: 24px;
font-weight: bold;
}
-->
</style>
<p align="center" class="Estilo1">Admin Panel AlternativeGC.com.ar </p>
<p><strong>Subir Foto: </strong></p>
<form action='' method='post' enctype='multipart/form-data'>
<p>PHOTO 1:
<input type=file name=photo[]>
<br>
PHOTO 2:
<input type=file name=photo[]>
<br>
PHOTO 3:
<input type=file name=photo[]>
<br>
PHOTO 4:
<input type=file name=photo[]>
<br>
PHOTO 5:
<input type=file name=photo[]>
</p>
<p>Carpeta : <select name="directorios" id="directorios">
<?php
// poner la ruta del directorio, en este caso es el actual
$dir = './';
if ($fd = opendir($dir)) {
while (($file = readdir($fd)) !== false) {
// Si es un directorio y es distinto al actual (.) y al anterior (..)
if (is_dir($dir . $file) && $file!="." && $file!="..") {
$opcion = '<option value="' . $file . '">' . $file . '</option>';
echo $opcion;
}
}
closedir($fd);
}
else {
echo "<br>No es ruta valida";
}
?>
</select>
<input type="submit" name="upload" value="Upload" />
</p>
<p> </p>
<p>
</form>
<p><strong>Crear Carpeta:</strong></p>
<form id="form1" name="form1" method="post" action="crear1.php">
<label for="textarea"></label>
<label for="textarea"></label>
<label for="textfield"></label>
<p>Nombre de Carpeta:
<input type="text" name="carpeta" id="carpeta" />
<input type="submit" name="Submit2" value="Crear Carpeta" id="Submit2" />
</p>
<p>
<label for="Submit"></label>
</p>
</form>
<p></p>
<p><strong>Borrar Carpeta:</strong></p>
<form name="form1" method="post" action="borrar1.php">
<label for="Submit"></label>
Carpeta :
<select name="directorios" id="directorios">
<?php
// poner la ruta del directorio, en este caso es el actual
$dir = './';
if ($fd = opendir($dir)) {
while (($file = readdir($fd)) !== false) {
// Si es un directorio y es distinto al actual (.) y al anterior (..)
if (is_dir($dir . $file) && $file!="." && $file!="..") {
$opcion = '<option value="' . $file . '">' . $file . '</option>';
echo $opcion;
}
}
closedir($fd);
}
else {
echo "<br>No es ruta valida";
}
?>
</select>
<input type="submit" name="Submit" value="Borrar" id="Submit">
</form> </p>
<p> </p>