Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/08/2007, 16:07
sisoma2
 
Fecha de Ingreso: agosto-2007
Mensajes: 11
Antigüedad: 19 años, 1 mes
Puntos: 0
Pregunta Problema con foros

Hola a todos,
Mi problema es que yo tengo un uploader de Imagenes y las imagenes subidas no se ven en foros. Aqui les dejo el código fuente:
Código PHP:
<?php 
$varrand 
= substr(md5(uniqid(rand())),0,5);        
$varallw = array("image/bmp","image/gif","image/jpeg","image/pjpeg","image/png","image/x-png","image/x-icon", "image/tiff");
$varpath = "http://imageshare.webspacemania.com/tmp/";
$varstat = "";

if (
$_POST["action"] == "upload") {
    if (
is_uploaded_file($_FILES["imagen"]["tmp_name"])) {
        
$varname = $_FILES["imagen"]['name'];
        
$vartemp = $_FILES['imagen']['tmp_name'];
        
$vartype = $_FILES["imagen"]['type'];
        
        if (
in_array($vartype, $varallw) && $varname != "") {
            
$varname = $varrand.".".$varname;
            if (
copy($vartemp, "tmp/".$varname)) {
                
$varpath = $varpath.$varname;

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