[英]how can i pass the data of the first form to the second one without recording those data on the database yet?
I have 2 forms on my project and their data must be recorded on the same row with the same database, so when you click the next button on the first form, the user will be directed to the second one, but I want not to record first its values on the database, because records/data of the first and the second form must be of the same row and I want them to be inserted on my database when you hit the save button on the second form, the issue here is that, how can i pass the data of the first form to the second one without recording those data on the database yet? 我的项目中有2个表单,并且它们的数据必须记录在同一数据库的同一行中,因此,当您单击第一个表单的下一个按钮时,用户将被定向到第二个表单,但是我不想记录首先将其值放在数据库中,因为第一种和第二种形式的记录/数据必须位于同一行,并且当您在第二种形式上单击保存按钮时,我希望将它们插入我的数据库中,这里的问题是,如何在不将那些数据记录到数据库的情况下将第一种格式的数据传递给第二种格式? Can anyone help me?Thanks a lot. 有人可以帮我吗?非常感谢。 :) :)
form1.php form1.php
<?php
session_start();
if(isset($_SESSION['name'])):
header("Location: http://mysite.ext/form2.php");
else:
?>
<form action="form2.php" method="POST" name="form1">
<input type="name" name="name"/><br/>
<input type="submit" value="Submit"/>
</form>
<?php endif; ?>
form2.php form2.php
<?php
session_start();
if(!isset($_SESSION['name'])):
header("Location: http://mysite.ext/form1.php");
elseif(isset($_POST['password'], $_SESSION['name'])):
echo 'Thank you', $_SESSION['name'] ,'. We will verify your password, ', $_POST['password'],' now.';
else:
?>
<form action="form2.php" method="POST" name="form2">
<input type="password" name="password"/><br/>
<input type="submit" value="Submit"/>
</form>
<?php endif; ?>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.