gracias........
este es el codigo
Código PHP:
<?
include ("includes/config.php");
include ("includes/funciones.php");
session_start();
$id= $_SESSION['evento'];
$cnx=conectar();
if ($_FILES['Filedata']['name']) {
//$nuevoNombre = time().".jpg";
$size = 151; // the thumbnail width
$filedir = 'galeria/'; // the directory for the original image
$thumbdir = 'galeria/'; // the directory for the thumbnail image
$prefix = 'big_';
$prefix1 = 'small_'; // the prefix to be added to the original name
$maxfile = '2000000';
$mode = '0666';
$userfile_name = $_FILES['Filedata']['name'];
$userfile_tmp = $_FILES['Filedata']['tmp_name'];
$userfile_size = $_FILES['Filedata']['size'];
$userfile_type = $_FILES['Filedata']['type'];
$prod_img = $filedir.$userfile_name;
$nuevoNombre = time();
$sufijo=".jpg";
//$prod_img_thumb = $thumbdir.$prefix.$nuevoNombre.$userfile_name;
//$prod_img_thumb1 = $thumbdir.$prefix1.$nuevoNombre.$userfile_name;
$prod_img_thumb = $thumbdir.$prefix.$userfile_name.$nuevoNombre.$sufijo;
$prod_img_thumb1 = $thumbdir.$prefix1.$userfile_name.$nuevoNombre.$sufijo;
move_uploaded_file($userfile_tmp, $prod_img);
$query = mysql_query("INSERT INTO imagenes (id_evento,galeria,image_small,image_big,image_real) VALUES "
."('$id','1','$prod_img_thumb1','$prod_img_thumb','$prod_img')");
}
?>