Tema: Validaciones
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/08/2010, 12:13
Urso
 
Fecha de Ingreso: agosto-2010
Ubicación: Mexico
Mensajes: 180
Antigüedad: 13 años, 8 meses
Puntos: 0
Validaciones

Tengo las validaciones siguientes y quiero saber si las puedo sustituir con algun tipo de funcion generica, ya que quiero separarlo del codigo principal.

IF(($Datos[2] AND preg_match("/([0-9])/",$Datos[2])==1) OR ($Datos[3] AND preg_match("/([0-9])/",$Datos[3])==1) OR ($Datos[4] AND preg_match("/([0-9])/",$Datos[4])==1))
{
ECHO "LOS CAMPOS DEL NOMBRE DEL EMPLEADO SOLO ACEPTAN LETRAS, REVISE<br/>";
$i++;
//ECHO "<meta http-equiv=refresh content=\"5; URL=abcEventos.php\">";
}

IF($Datos[5] AND preg_match("/(\d{4}\-\d{2}\-\d{2})/",$Datos[5])==0)
{
ECHO "LA FECHA DE LA FALTA TO TIENE EL FORMATO AAAA-MM-DD, REVISE<br/>";
$i++;
//ECHO "<meta http-equiv=refresh content=\"5; URL=abcEventos.php\">";
}

IF(($Datos[6] AND preg_match("/([0-9])/",$Datos[6])==1))
{
ECHO "LA JUSTIFICACION SOLO ACEPTA LETRA, REVISE<br/>";
$i++;
//ECHO "<meta http-equiv=refresh content=\"5; URL=abcEventos.php\">";
}

IF($i<1)
{
//Instrucciones que necesarias que se quieran realizar
}