I need to send POST information to a page and redirect me to another

0

It turns out that I'm working on a form where I have to save a user and an input, I need the information sent to "list" to save it, but it's a 2-step form, from the user register to the input record sale and then to list, then from the user record I need the information to be sent to list but continue on the page I need to register the input, I do not know if I explain.

<form action="ingresar_venta.php" method="post" id="form" name="form" onsubmit="return validar();">
			<table align="center" style="font-size: 20px;">
				<tr>
					<td>Rut</td>
					<td><input type="text" name="txt_rut" id="rut" required=""></td>
				</tr>
				<tr>
					<td>Nombre</td>
					<td><input type="text" name="txt_nombre" id="nombre" required=""></td>
				</tr>
				<tr>
					<td>Apellido</td>
					<td><input type="text" name="txt_appelido" id="apellido" required=""></td>
				</tr>
				<tr>
					<td>Telefono</td>
					<td><input type="text" name="txt_telefono" id="telefono" required=""></td>
				</tr>
				<tr>
					<td>Direccion</td>
					<td><input type="text" name="txt_direccion" id="direccion" required=""></td>
				</tr>
				<tr>
					<td>Region</td>
					<td>
						<select name="txt_region" id="region" required="">
							<option value="I">I-de Tarapacá</option>
							<option value="II">II-de Antofagasta</option>
							<option value="III">III-de Atacama</option>
							<option value="IV">IV-de Coquimbo</option>
							<option value="V">V-de Valparaíso</option>
							<option value="VI">VI-del Libertador General Bernardo O'Higgins</option>
							<option value="VII">VII-del Maule</option>
							<option value="VIII">VIII-del Bio Bio</option>
							<option value="IX">IX-de la Araucanía</option>
							<option value="X">X-de los Lagos</option>
							<option value="XI">XI-Aisén del General Carlos Ibáñez del Campo</option>
							<option value="XII">XII-de Magallanes y Antártica Chilena</option>
							<option value="XIV">XIV-de los Ríos</option>
							<option value="XV">XV-de Arica y Parinacota</option>
							<option value="RM">RM-Region Metropolitana</option>
						</select>
					</td>
				</tr>
				<tr>
					<td>Comuna</td>
					<td>
						<select name="txt_comuna" id="comuna" required=""></select>
					</td>
				</tr>
				<tr>
					<td>Correo</td>
					<td><input type="text" name="txt_correo" id="correo" required=""></td>
				</tr>
				<tr>
					<td><input class="submit" type="submit" value="Siguiente">
              <input type="submit" value="Cancelar" onclick="location.href='../index.html';"></td>
				</tr>
			</table>
		</form>
    
asked by Ivan Arenas 27.05.2018 в 08:38
source

1 answer

0

You can not send information to a page that is not rendered in the browser unless it is saved in the database. The solution that I see to your problem is that you are dragging values until you reach the final page, through hidden inputs.

Example :

  

Page 1:

<form action="insumo.php" method="post">
    <input type="text" name="usuario" />
    <input type="submit" value="Enviar" />
</form>
  

Page 2:

<form action="listar.php" method="post">
    <input type="hidden" name="usuario" value="<?= $_POST['usuario'] ?>"/>
    ...
    <input type="submit" value="Enviar" />
</form>
    
answered by 27.05.2018 в 10:36