Ver Mensaje Individual
  #4 (permalink)  
Antiguo 09/10/2007, 14:55
joaquina5
 
Fecha de Ingreso: octubre-2007
Mensajes: 41
Antigüedad: 16 años, 6 meses
Puntos: 0
Re: problema, necesito anteponer nºs aleatorios delante del archivo a subir

Lo siento mucho preo el problema es doble 1º no me funciona y 2º soy novato
parte del codigo es este y no se que cambios hacer ni donde meter nada:

$_POST['club'] = mosGetParam($_POST, 'club');
$_POST['city'] = mosGetParam($_POST, 'city');
$_POST['street'] = mosGetParam($_POST, 'street');
$_POST['plz'] = mosGetParam($_POST, 'plz');
$_POST['country'] = mosGetParam($_POST, 'country');

//Bild
$userfile2=(isset($_FILES['userfile']['tmp_name']) ? $_FILES['userfile']['tmp_name'] : "");
$userfile_name=(isset($_FILES['userfile']['name']) ? $_FILES['userfile']['name'] : "");
$imagesize = $_FILES['userfile']['size'];

if (( $imageenabled == 2 ) || ( ($imageenabled == 1) && (!empty($userfile_name)) ) ) {

$base_Dir = ELPATH.'/../../images/eventlist/location/';
$sizelimit = $sizelimit*1024; //size limit in kb

if (empty($userfile_name)) {
mosRedirect("index.php?option=$option&Itemid=$Item id", _EVENTS_IMAGEEMPT." ");
}

if ($imagesize > $sizelimit) {
mosRedirect("index.php?option=$option&Itemid=$Item id", _EVENTS_IMAGESIZEBIG." ");
}

$filename = split("\.", $userfile_name);

if (eregi("[^0-9a-zA-Z_]", $filename[0])) {
mosRedirect("index.php?option=$option&Itemid=$Item id", _EVENTS_IMAGECHARACT." ");
}

if (file_exists($base_Dir.$userfile_name)) {
mosRedirect("index.php?option=$option&Itemid=$Item id", _EVENTS_IMAGEEXIST." ");
}

if ((strcasecmp(substr($userfile_name,-4),".gif")) && (strcasecmp(substr($userfile_name,-4),".jpg")) && (strcasecmp(substr($userfile_name,-4),".png")) && (strcasecmp(substr($userfile_name,-4),".bmp"))) {
mosRedirect("index.php?option=$option&Itemid=$Item id", _EVENTS_IMAGETYPE." ");
}

if (!move_uploaded_file ($_FILES['userfile']['tmp_name'],$base_Dir.$_FILES['userfile']['name']) || !mosChmod($base_Dir.$_FILES['userfile']['name'])) {
mosRedirect("index.php?option=$option&Itemid=$Item id", _EVENTS_IMAGEFAIL." ");
} else {
$file = $base_Dir.$userfile_name;

//chmod Bild
@chmod ($file, octdec($imagechmod));

//Vorbereiten auf Thumbnailerstellung
$thumbdir = $base_Dir.'small/';
$save = $thumbdir.$userfile_name;

if ($imageprob = 1) {
$imageprob = TRUE;
} else {
$imageprob = FALSE;
}

if ($gddisabled == 1) {
evlist_imgd::thumb($file, $save, $imagewidth, $imagehight, $imageprob);
}
}

$_POST['locimage'] = $userfile_name ;
}



de verdad necesito este cambio.
gracias a todos