Created
March 18, 2010 09:42
-
-
Save juananruiz/336210 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| if ($_POST) | |
| { | |
| //Me traigo los datos que podrían interesarme: | |
| $name = $params['name']; | |
| $tipo = $params['tipo']; | |
| $name = explode(", ",$name); | |
| echo '<ul>'; | |
| foreach ( $name as $valor) | |
| { | |
| // Entramos en el largo apartado de errores posibles. | |
| //¡Hagan sitio: los posibles errores nunca acabarán de crecer! | |
| if ($tipo = obligado && $_POST["$valor"] == '') | |
| { | |
| $error = 'Debe rellenar el campo.' .$valor; | |
| } | |
| session_start(); | |
| if ($error != '') | |
| { | |
| $_SESSION['errores_formulario'][$valor] = $error; | |
| echo '<li>' . $error . '</li>'; | |
| } | |
| } | |
| echo '</ul>'; | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment