Foros del Web » Programando para Internet » ASPX (.net) »

Form con doble action

Estas en el tema de Form con doble action en el foro de ASPX (.net) en Foros del Web. saludos, tngo un form donde debo hacer q el me lea un archivo y a parte de eso debe contener el <?=$PHP_SELF?> en el action... ...
  #1 (permalink)  
Antiguo 18/06/2008, 09:47
Avatar de T4ke0veR  
Fecha de Ingreso: agosto-2007
Ubicación: Quito - Ecuador
Mensajes: 1.720
Antigüedad: 16 años, 8 meses
Puntos: 28
Form con doble action

saludos,
tngo un form donde debo hacer q el me lea un archivo y a parte de eso debe contener el <?=$PHP_SELF?> en el action... como puedo hacer esto?

el form es este
Código PHP:
<form method="post" id="registerForm" action="register.php" enctype="multipart/form-data">
                                          <
table align="center" cellpadding="2" cellspacing="0">
                                            <
tr>
                                              <
td width="120" style="width:120px"><div align="right" class="textoResto">Nombre: </div></td>
                <
td width="172"><div align="left" class="string">
                  <
input name="nombre" type="text" class="input" id="nombre" value="" size="32" />
                  </
div>              </td>
              </
tr>
                                            <
tr>
                                              <
td class="textoResto" style="width:120px"><div align="right">Apellido: </div></td>
                <
td><div align="left">
                  <
input name="apellido" class="input" type="text" id="apellido" value="" size="32" />
                  </
div></td>
              </
tr>
                                            <
tr>
                                              <
td class="textoResto" style="width:120px"><div align="right">Usuario: </div></td>
                <
td><div align="left">
                  <
input name="usuario" type="text" class="input" id="usuario" value="" size="32" />
                  </
div>              </td>
              </
tr>
                                            <
tr>
                                              <
td class="textoResto" style="width:120px"><div align="right">Contraseña: </div></td>
                <
td><div align="left">
                  <
input name="pass" type="password" class="input" id="pass" value="" size="32" />
                  </
div></td>
              </
tr>
                                            <
tr>
                                              
                                              <
td class="textoResto" style="width:120px"><div align="right">Repetir Contraseña: </div></td>
                <
td><div align="left">
                  <
input name="re_pass" type="password" class="input" id="re_pass" value="" size="32" />
                  </
div></td>
              </
tr>
                                            <
tr>
                                              
                                              <
td class="textoResto" style="width:120px"><div align="right">E-Mail: </div></td>
                <
td><div align="left">
                  <
input name="mail" type="text" class="input" id="mail" value="" size="32" />
                  </
div></td>
              </
tr>
                                            <
tr>
                                              <
td style="width:120px"><div align="right" class="textoResto">C.I. / RIF.:</div></td>
                <
td><input name="cedula" type="text" class="input" id="cedula" value="" size="32" /></td>
              </
tr>
                                            <
tr>
                                              <
td style="width:120px"><div align="right" class="textoResto">Teléfono: </div></td>
                <
td><input name="telefono" type="text" class="input" id="telefono" value="" size="32" /></td>
              </
tr>
                                            <
tr>
                                              <
td style="width:120px"><div align="right" class="textoResto">Fecha: </div></td>
                <
td><div align="left">
                  <
input name="fecha" type="text" class="input" id="fecha" value="" size="25" />
                </
div></td>
              </
tr>
                                            <
tr>
                                              <
td colspan="2"><div align="right">
                                                <
input type="image" name="subir" class="submit-btn" src="btn.gif" alt="submit" title="submit" />
                                                </
div></td>
              </
tr>
                                            </
table>
          </
form
y me debe leer este archivo
Código PHP:
<?php
    
include('functions.php');

    if (
$_POST['nombre']=='' || strlen($_POST['nombre'])<3)
    {
        
$errors[] = 'Nomnbre debe poseer al menos 3 letras.';
    }

    if (
$_POST['apellido']=='' || strlen($_POST['apellido'])<3)
    {
        
$errors[] = 'Apellido debe poseer al menos 3 letras.';
    }

    if (
$_POST['usuario']=='' || alpha_numeric($_POST['usuario'])==FALSE)
    {
        
$errors[] = 'Usuario debe contener valores alfa-numéricos';
    }

    if (
$_POST['pass']=='' || alpha_numeric($_POST['pass'])==FALSE)
    {
        
$errors[] = 'A password is required and must be alpha-numeric';
    }

    if (
$_POST['pass']!=$_POST['re_pass'])
    {
        
$errors[] = 'The two passwords must match';
    }

    if (
valid_email($_POST['mail'])==FALSE)
    {
        
$errors[] = 'Please supply a valid email address';
    }
    if (
$_POST['cedula']=='' || strlen($_POST['cedula'])<3)
    {
        
$errors[] = 'Cedula name is required and must contain 3 characters or more';
    }
    if (
$_POST['telefono']=='' || strlen($_POST['telefono'])<3)
    {
        
$errors[] = 'Telefono name is required and must contain 3 characters or more';
    }
    if (
$_POST['fecha']=='' || strlen($_POST['fecha'])<3)
    {
        
$errors[] = 'Fecha name is required and must contain 3 characters or more';
    }

    if(
is_array($errors))
    {
        echo 
'<p class="error"><b>The following errors occured</b></p>';
        while (list(
$key,$value) = each($errors))
        {

            echo 
'<span class="error">'.$value.'</span><br />';
        }
    }
    else {
         include (
'conect.php');



    if (isset(
$_POST['subir'])) {

            
extract($_POST);



            if (empty(
$activo)){

            
$activo=2;

            }

        
$query="INSERT INTO clientes SET

        nombre = '$nombre',

        apellido = '$apellido',

        usuario = '$usuario',
        
        pass = '$pass',
        
        mail = '$mail',
        
        cedula = '$cedula',
        
        telefono = '$telefono',
        
        fecha = '$fecha'"
;    

        
mysql_query($query);

    }            
        echo 
'<p><b>Felicitaciones!</b></p>';
        echo 
'<span>Tu registro ha sido procesado con éxito. Ahora puedes ingresar usando tu usuario y contraseña. gracias por registrarte !</span>';
    }
?>
pero por cuestiones del insert debe tambien llevar en el action lo q les dije

SOS plz
gracias d antemano
__________________
Diseño gráfico, Web, imagen corporativa, publicidad ...
  #2 (permalink)  
Antiguo 18/06/2008, 09:49
Avatar de Peterpay
Colaborador
 
Fecha de Ingreso: septiembre-2007
Ubicación: San Francisco, United States
Mensajes: 3.858
Antigüedad: 16 años, 7 meses
Puntos: 87
Respuesta: Form con doble action

foro equivocado
__________________
Curso WF4
http://cursos.gurudotnet.com/ DF
Aprende HTML5
  #3 (permalink)  
Antiguo 18/06/2008, 12:15
Avatar de T4ke0veR  
Fecha de Ingreso: agosto-2007
Ubicación: Quito - Ecuador
Mensajes: 1.720
Antigüedad: 16 años, 8 meses
Puntos: 28
Respuesta: Form con doble action

me imprime asi
echo ($_POST['nombre']);
__________________
Diseño gráfico, Web, imagen corporativa, publicidad ...
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 17:06.