Tema: Upload
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/12/2002, 13:45
Avatar de Maycol
Maycol
 
Fecha de Ingreso: diciembre-2001
Ubicación: Ávila (España)
Mensajes: 539
Antigüedad: 22 años, 4 meses
Puntos: 0
Upload

Hola.
Quiero hacer un script para subir archivos y que compruebe si el archivo subido es .GIF, .JPG o .PNG al servidor, este es el form:
Código PHP:
<FORM ACTION="subir.php" METHOD="POST">
Imagen:<br>
<
input type="file" name="imagen"><br>
<
INPUT TYPE="submit" VALUE="Subir"
</
form
Y tengo esto pero no funciona:

Código PHP:
$path "/home... etc";

$fichero $path "/" $HTTP_POST_FILES['imagen']['name'];

ereg"([a-z0-9\._-].[a-z0-9_-]"$imagen_name$regs);
    echo 
"$regs[1]";

ereg"([a-z0-9_-])\.([a-z0-9_-])"$HTTP_POST_FILES['imagen']['name'], $regs);


if(
$regs[2] == "jpg" or $regs == "png" or $regs == "gif"){
copy($archivo$fichero);


A ver si me podeis ayudar que esto no va.

Saludos.
__________________
Zepsilon.com
Diseño e imaginacion