Ver Mensaje Individual
  #11 (permalink)  
Antiguo 02/09/2007, 12:38
Avatar de manumaf
manumaf
 
Fecha de Ingreso: mayo-2007
Ubicación: Argentina
Mensajes: 854
Antigüedad: 19 años, 5 meses
Puntos: 6
Re: Crear UPLOAD de imagenes

No me funciona! Miren me quedo asi:

Formulario:
Código HTML:
<form action="upload.php" method="post" enctype="multipart/form-data">
<span class="estilo">Seleccione el archivo:</span>
<input type="file" name="foto"><br>
<input type="submit" value="Enviar" name="action">
</form> 
upload.php
Código PHP:
<?php  
$varrand 
= substr(md5(uniqid(rand())),0,5);         
$varallw = array("image/gif","image/jpeg","image/png","image/x-png"); 
$varpath = "/public_html/hotimg/img/"; 
$varstat = ""; 

if (
$_POST["action"] == "Enviar") { 
    if (
is_uploaded_file($_FILES["archivo"]["tmp_name"])) { 
        
$varname = $_FILES["archivo"]['name']; 
        
$vartemp = $_FILES["archivo"]['tmp_name']; 
        
$vartype = $_FILES["archivo"]['type']; 
         
        if ((
$_FILES["archivo"]['size']/1024) > 1024) {
        if (
in_array($vartype, $varallw) && $varname != "") { 
            
$varname = $varrand.".".$varname; 
            if (
copy($vartemp, "/public_html/hotimg/img/".$varname)) { 
                
$varpath = $varpath.$varname; 

                
$varstat = "ok"; 
            } else { 
                
$varstat = "Error al subir el archivo"; 
            } 
        } else { 
            
$varstat = "Archivo no valido"; 
        } 
    } 
} 
?>
Donde ta el error