![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
11/12/2003, 05:56
|
![Avatar de jercer](http://static.forosdelweb.com/customavatars/avatar44373_1.gif) | | | Fecha de Ingreso: octubre-2003
Mensajes: 373
Antigüedad: 21 años, 3 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)\">";
}
} |