Ver Mensaje Individual
  #8 (permalink)  
Antiguo 11/12/2003, 05:56
Avatar de jercer
jercer
 
Fecha de Ingreso: octubre-2003
Mensajes: 373
Antigüedad: 20 años, 6 meses
Puntos: 13
Cambia:

if (isset($_POST["enviar"])){
if(empty($_POST[nombre])){
echo "Debes escribir un nombre.";
echo "<input TYPE=\"button\" VALUE=\" ATRÁS\" onClick=\"history.go(-1)\">";
exit;
}
if(empty($_POST[email])){
echo "Debes colocar tu email.";
echo "<input TYPE=\"button\" VALUE=\" ATRÁS\" onClick=\"history.go(-1)\">";
exit;
}
}

Por:

$mensaje = "";
if (isset($_POST["enviar"])){
if(empty($_POST[nombre])){
$mensaje .= "Debes escribir un nombre.<br>";
}
if(empty($_POST[email])){
$mensaje .= "Debes colocar tu email.<br>";
}
if ($mensaje != ""){
echo "Se han producido los siguientes errores:<br>".$mensaje;
echo "<input TYPE=\"button\" VALUE=\" ATRÁS\" onClick=\"history.go(-1)\">";

}
}