Skip to content

Instantly share code, notes, and snippets.

@juananruiz
Created March 18, 2010 09:42
Show Gist options
  • Select an option

  • Save juananruiz/336210 to your computer and use it in GitHub Desktop.

Select an option

Save juananruiz/336210 to your computer and use it in GitHub Desktop.
<?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