Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/05/2008, 08:17
yonolose
(Desactivado)
 
Fecha de Ingreso: marzo-2008
Mensajes: 641
Antigüedad: 16 años, 1 mes
Puntos: 7
Formulario en php si se cumple la condicción

Hola, tengo un script. Y quiero que si no se cumple una condicción, muestre un formulario. Lo hago así, pero no funciona. ¿Cómo lo hago?. Es importante que sean campos ocultos y que tengan el valor de las variables.

<?php
$nombre=$_POST['Nombre'];
$chiste=$_POST['Chiste'];
$tabla=$_POST['tabla'];
$box=$_POST['box'];
if(strlen($nombre) == 0){
$errores++;
}
if(strlen($box) == 0){
$errores++;
}
if(strlen($chiste) == 0){
$errores++;
}
if(strlen($tabla) == 0){
$errores++;
}
if($errores >0){
echo "<h1><font color='#0000CC'/>Lo siento, falta algún campo por rellenar</h1>";
exit();
} else {
echo $nombre . "<br />" . "<br />" . $chiste . "<br />" . "<br />";
echo ""<form action="sendjoke.php" method="post" /><input type="hidden" value="<?php $nombre; ?>" name="nombre" /><input type="submit" value="ENVIAR" name="Sumbit" />"";
}
?>