Php 使用两个网页提交表单值
我一共有3页;表单元素分布在两个页面“eg1.html”和“eg2.html”中,但表单元素提交到“eg.php” 下面是eg.php的代码:Php 使用两个网页提交表单值,php,javascript,jquery,html,dhtml,Php,Javascript,Jquery,Html,Dhtml,我一共有3页;表单元素分布在两个页面“eg1.html”和“eg2.html”中,但表单元素提交到“eg.php” 下面是eg.php的代码: $size=$_POST["fontsize"]; $label=$_POST["label"]; $age=$_POST["age"]; $sex =$_POST["sex"]; eg1.html的代码 <html> <body> <form action="eg.php" method="post">
$size=$_POST["fontsize"];
$label=$_POST["label"];
$age=$_POST["age"];
$sex =$_POST["sex"];
eg1.html的代码
<html>
<body>
<form action="eg.php" method="post">
<input type="radio" name="fontsize" value="3"/>
<link to eg2.html>
<input type="radio" name="label" value="stacks"/>
<input type="submit" name = "down" value = "down">
</form>
</body>
<html>
<body>
<form action="eg.php" method="post">
<input type="radio" name="age" value="18"/>
<input type="radio" name="sex" value="female"/>
<input type="submit" name = "down" value = "down">
</form>
</body>
</html>
eg2.html的代码
<html>
<body>
<form action="eg.php" method="post">
<input type="radio" name="fontsize" value="3"/>
<link to eg2.html>
<input type="radio" name="label" value="stacks"/>
<input type="submit" name = "down" value = "down">
</form>
</body>
<html>
<body>
<form action="eg.php" method="post">
<input type="radio" name="age" value="18"/>
<input type="radio" name="sex" value="female"/>
<input type="submit" name = "down" value = "down">
</form>
</body>
</html>
我在eg1.html
中添加了一个指向eg2.html
的链接。这意味着首先用户将打开eg1.html
;他将在提交表单元素之前选择表单元素,他将获得一个链接,链接到eg2.html
;一旦他点击链接,他将被重定向到eg2.html
在eg2.html
中,他应该能够选择其他表单元素,选择后他将被重定向回eg1.html
,在那里他将能够将所有表单元素提交到eg.php
[其中包括eg1和eg2]
我见过许多网站使用这项技术。根据您希望如何处理这项技术,您可以
location.hash
将该信息附加到下一页的链接中。或者,您可以使用
第三个也相对容易实现。对每页使用
divs
或iframes
,并让顶部文档保存数据。?请解释清楚。听起来您的用户正在部分填写表单,提交表单,然后返回完成表单。对吗?请检查你的拼写;这是很难破译你的句子,因为是的,因为我已经提到表单元素分布在两个页面eg1.html和eg2.html中…请检查eg1.html中是否有,这意味着用户没有提交表单,他应该单击链接,该链接将他重定向到eg2.html,他将在那里选择并提交将要获取的值通过eg.php,然后他将被重定向回eg1.html,以提交eg.php中的其他值……你可以将其拆分为多个句子吗?思路打字很难理解。甚至可以尝试一个图表?web上的表单有一个核心规则:始终向自身发送表单,在那里验证表单,然后在必要时重定向。