Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/08/2013, 15:19
jorgemibanez
Invitado
 
Mensajes: n/a
Puntos:
Pregunta Error de variable indefinida en código PHP de subida de imagen

Este código sube correctamente la imagen a una carpeta al servidor, pero me aparece un mensaje de error, las variables en negrita son las que aparecen como "Undefinied", el código funciona pero no es nada agradable que después de subir la foto, arriba del mensaje de que ha sido subida correctamente aparezcan estos dos errores:
<?php
$target = "images/";
$target = $target . basename( $_FILES['filUpload']['name']) ;
$ok=1;

//This is our size condition
if ($filUpload_size > 350000)
{
echo "Your file is too large.<br>";
$ok=0;
}

//This is our limit file type condition
if ($filUpload_type =="text/php")
{
echo "No PHP files<br>";
$ok=0;
}

//Here we check that $ok was not set to 0 by an error
if ($ok==0)
{
Echo "Sorry your file was not uploaded";
}

//If everything is ok we try to upload it
else
{
if(move_uploaded_file($_FILES['filUpload']['tmp_name'], $target))
{
echo "The file ". basename( $_FILES['filUpload']['name']). " has been uploaded";
}
else
{
echo "Sorry, there was a problem uploading your file.";
}
}
?>
Alguna recomendación, gracias por sus respuestas.