Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/08/2007, 09:49
The Neurochild
 
Fecha de Ingreso: marzo-2007
Mensajes: 53
Antigüedad: 17 años, 1 mes
Puntos: 0
Problemas con campos de texto

lo que trato de hacer es que de una página, de donde se ha definido previamente un número de campos de texto, genere en la siguiente página con la cantidad establecida. Pero no suficiente con eso, que esos campos de texto puedan funcionar perfectamente y que se guarden en variables de sesión de la misma cantidad de campos que hay en esa página.

sé que existen array de vectores, pero no sé si se puede aplicar lo mismo en variables de sesión

he aquí un ejemplo

Código PHP:
<?
session_start
();
$virtualnum 0;
$_SESSION["virtualnum"] = 0;
 
if (
$_SESSION["pagina"] != "Location: afiliacion1_2.php")
{
header("Location: afiliacion1_1.php");
}
 
if( isset( 
$_POST['Enviar'] ) ) 
{
   
$virtualnum trim$_POST['virtualnum'] );
 
   if ( !empty( 
$virtualnum ) )
   {
      
$virtualnum $_POST['virtualnum'];
      
$_SESSION["virtualnum"] = $virtualnum;
      
$_SESSION["pagina"] = "Location: afiliacion2.php";
      
header("Location: afiliacion2.php");
   }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Equiphone :: Afiliaci&oacute;n</title>
<style type="text/css">
<!--
body,td,th {
    color: #000000;
    font-family: Geneva, Arial, Helvetica, sans-serif;
}
body {
    background-color: #FFFFFF;
}
a:link {
    color: #000000;
}
a:visited {
    color: #000000;
}
a:hover {
    color: #000000;
}
a:active {
    color: #000000;
}
.Estilo7 {font-size: 12px}
.Estilo9 {font-size: 12px; font-weight: bold; }
.Estilo10 {
    font-size: 12px;
    color: #FF3333;
    font-weight: bold;
}
.Estilo11 {font-size: 12px; color: #FFFFFF; }
.Estilo21 {color: #FF0000}
.Estilo27 {
    font-size: 14;
    font-weight: bold;
    color: #339900;
}
.Estilo28 {color: #FF0033}
-->
</style>
</head>
 
<body>
<table width="720" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="2"><img src="images/EquiPhone.jpg" width="303" height="108" /></td>
  </tr>
  <tr>
    <td colspan="2" align="center"><img src="images/header2.jpg" width="720" height="321" /></td>
  </tr>
  <tr>
    <td colspan="2"><p><strong>Afiliaci&oacute;n:</strong></p>
      <p><strong>Solucitud de N&uacute;meros Virtuales.</strong></p>
      <p class="Estilo7">Los n&uacute;meros que solicite en esta secci&oacute;n ser&aacute;n verificados por nuestro sistema. En caso de estar disponible, se le notificar&aacute; via e-mail.</p>
      <form id="factura" name="factura" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
        <table border="1" align="center" cellpadding="10" cellspacing="0" bordercolor="#000000">
          <tr>
            <td width="337" align="right"><span class="Estilo9">N&uacute;mero virtual de 7 n&uacute;meros:</span></td>
            <td width="337"><label>
              <input name="virtualnum" type="text" id="virtualnum" size="7" maxlength="7" />
            </label></td>
          </tr>
          <tr>
            <td colspan="2" align="right" valign="top" bordercolor="#000000"><input name="Enviar" type="submit" id="Enviar" value="Siguiente" /></td>
          </tr>
        </table>
      </form>
    </td>
  </tr>
  <tr>
    <td width="200" height="75" bgcolor="#FF0000"><table border="0" align="center" cellpadding="10" cellspacing="0">
      <tr>
        <td><p class="Estilo11">&copy; 2007 Equiphone.<br />
          Todos los derechos reservados. </p></td>
      </tr>
    </table></td>
    <td width="520" bgcolor="#CCCCCC"><div align="center"><strong><span class="Estilo7"><a href="index.php">Home</a> | <a href="productos.php">Productos</a> | <a href="servicios.php">Servicios</a> | <a href="cuenta.php">Su Cuenta</a> | <a href="soporte.php">Soporte</a> | <a href="contactos.php">Cont&aacute;ctenos</a></span></strong></div></td>
  </tr>
</table>
</body>
</html>
La variable en cuestión se llama "virtualnum"

Última edición por The Neurochild; 28/08/2007 a las 09:50 Razón: Informacion importante