Ver Mensaje Individual
  #8 (permalink)  
Antiguo 29/03/2007, 14:00
The Neurochild
 
Fecha de Ingreso: marzo-2007
Mensajes: 53
Antigüedad: 17 años, 1 mes
Puntos: 0
Re: Problema con Formulario en PHP

Tengo otro problema, pero con PHP, necesito de su ayuda para resolverlo.

aquí va la parte 1

Código:
<?php 
$titulo = ""; 
$nombres = ""; 
$apellidos = ""; 
$sexo = ""; 
$email = ""; 
$tipodireccion = ""; 
$direccion = ""; 
$pais = ""; 
$zip = ""; 
$estado = ""; 
$ciudad = ""; 
$contrasena = ""; 
$confirmar = ""; 
$payment = ""; 
$numtarjeta = ""; 
$month = ""; 
$year = ""; 
$codigo = ""; 
if( isset( $_POST['submit'] ) ) 
{ 
 
   $titulo = trim( $_POST['titulo'] ); 
   $nombres = trim( $_POST['nombres'] ); 
   $apellidos = trim( $_POST['apellidos'] ); 
   $sexo = trim( $_POST['sexo'] );
   $email = trim( $_POST['email'] ); 
   $tipodireccion = trim( $_POST['tipodireccion'] ); 
   $direccion = trim( $_POST['direccion'] ); 
   $pais = trim( $_POST['pais'] ); 
   $zip = trim( $_POST['zip'] ); 
   $estado = trim( $_POST['estado'] ); 
   $ciudad = trim( $_POST['ciudad'] ); 
   $contrasena = trim( $_POST['contrasena'] ); 
   $confirmar = trim( $_POST['confirmar'] ); 
   $payment = trim( $_POST['payment'] ); 
   $numtarjeta = trim( $_POST['numtarjeta'] ); 
   $month = trim( $_POST['month'] ); 
   $year = trim( $_POST['year'] ); 
   $codigo = trim( $_POST['codigo'] ); 
 
 
   // validamos que se hayan enviado los campos nombre, edad y alguno de los 2 apellidos 
   if( ( !empty( $titulo ) && !is_numeric( $titulo ) ) && ( !empty( $nombres ) && !is_numeric( $nombres ) ) && ( !empty( $apellidos ) && !is_numeric( $apellidos ) ) && ( !empty( $sexo ) && !is_numeric( $sexo ) ) && !empty( $email ) && ( !empty( $tipodireccion ) && !is_numeric( $tipodireccion ) ) && !empty( $direccion ) && ( !empty( $pais ) && !is_numeric( $pais ) ) && ( !empty( $zip ) && is_numeric( $zip ) ) && ( !empty( $estado ) && !is_numeric( $estado ) ) && ( !empty( $ciudad ) && !is_numeric( $ciudad ) ) && !empty( $contrasena ) && !empty( $confirmar ) && ( $contrasena == $confirmar ) && ( !empty( $payment ) && !is_numeric( $payment ) ) && ( !empty( $numtarjeta ) && is_numeric( $numtarjeta ) ) && ( !empty( $month ) && is_numeric( $month ) ) && ( !empty( $year ) && is_numeric( $year ) ) && ( !empty( $codigo ) && is_numeric( $codigo ) ) ) 
   { 
      header("Location: bienvenida.php");  
      exit; 
   } 
   else 
   { 
      if( empty( $titulo ) || is_numeric( $titulo ) ) 
         $titulo = $titulo."\" style=\"background-color: #FF0000\""; 
      if( empty( $nombres ) || is_numeric( $nombres ) ) 
         $nombres = $nombres."\" style=\"background-color: #FF0000\""; 
      if( empty( $apellidos ) || is_numeric( $apellidos ) ) 
         $apellidos = $apellidos."\" style=\"background-color: #FF0000\""; 
      if( empty( $sexo ) || is_numeric( $sexo ) ) 
         $sexo = $sexo."\" style=\"background-color: #FF0000\""; 
      if( empty( $email ) ) 
         $email = $email."\" style=\"background-color: #FF0000\""; 
      if( empty( $tipodireccion ) || is_numeric( $tipodireccion ) ) 
         $tipodireccion = $tipodireccion."\" style=\"background-color: #FF0000\""; 
      if( empty( $direccion ) ) 
         $direccion = $direccion."\" style=\"background-color: #FF0000\""; 
      if( empty( $pais ) || is_numeric( $pais ) ) 
         $pais = $pais."\" style=\"background-color: #FF0000\""; 
      if( empty( $zip ) || is_numeric( $zip ) ) 
         $zip = $zip."\" style=\"background-color: #FF0000\""; 
      if( empty( $estado ) || is_numeric( $estado ) ) 
         $estado = $estado."\" style=\"background-color: #FF0000\""; 
      if( empty( $ciudad ) || is_numeric( $ciudad ) ) 
         $ciudad = $ciudad."\" style=\"background-color: #FF0000\""; 
      if( empty( $contrasena ) ) 
         $contrasena = $contrasena."\" style=\"background-color: #FF0000\""; 
      if( empty( $confirmar ) ) 
         $confirmar = $confirmar."\" style=\"background-color: #FF0000\""; 
      if( $contrasena != $confirmar ) ) 
      { 
         $ape_pat = $ape_pat."\" style=\"background-color: #00FF00\""; 
         $ape_mat = $ape_mat."\" style=\"background-color: #00FF00\""; 
      } 
      if( empty( $payment ) || is_numeric( $payment ) ) 
         $payment = $payment."\" style=\"background-color: #FF0000\""; 
      if( empty( $numtarjeta ) || !is_numeric( $numtarjeta ) ) 
         $numtarjeta = $numtarjeta."\" style=\"background-color: #FF0000\""; 
      if( empty( $month ) || !is_numeric( $month ) ) 
         $month = $month."\" style=\"background-color: #FF0000\""; 
      if( empty( $year ) || !is_numeric( $year ) ) 
         $year = $year."\" style=\"background-color: #FF0000\""; 
      if( empty( $codigo ) || !is_numeric( $codigo ) ) 
         $codigo = $codigo."\" style=\"background-color: #FF0000\""; 
   } 
} 
?>