Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/04/2009, 05:46
mesoriginal
 
Fecha de Ingreso: septiembre-2008
Mensajes: 211
Antigüedad: 15 años, 7 meses
Puntos: 2
Detectar si existe o no la imagen en el file

Hola mi problema es el siguiente: Tengo un formulario donde hay diversos INPUT en forma de texto i algun OPTION estos los controlo por el name="loquesea" que les doy. El problema esta en la imagen:

<INPUT TYPE="file" NAME="html_file" ACCEPT="text/html">

Como hago para detectar si alguien puso la imagen en el formulario o no? Es decir:

Código PHP:
<?

$texto1
=$_POST[texto1];
$texto2=$_POST[texto2];
$imagen=$_POST[html_file];

if(
$_POST[html_file] == NULL){ echo "No hay imagen";}
else{ echo 
"Hay imagen" }

?>

Código HTML:
<form enctype="multipart/form-data" method="post" action="">
<input name="texto1" maxLength="150" type="text" size=35>
<input name="texto2" maxLength="150" type="text" size=35>
<input name="html_file" type="file"  accept="text/html">
<input type="submit" name="Submit" value="Submit"> 

Gracias!