我正在尝试构建一个分布在两页的简单HTML表单.第一页询问用户的名字和姓氏.第二页询问他的国家以及他是否想要收到更多信息.
第一页有一个名为"Next"的按钮,用于转到第二页.第二页有两个按钮,名为"Next",下一页(目前不存在),"Back"返回第一页.
在单击"下一步"按钮的第一页上,没有任何反应.如何点击它进入下一页?
这是我的代码:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<?php
if(!isset($_POST['next1']))
Display1();
else if(isset($_POST['next1']))
Display2();
else if(isset($_POST['back1']))
Display1();
?>
<?php
function Display1()
{
?>
<form id="form1" action="Multi.php" method="post">
<label>Enter First Name: </label>
<input type="text" name="text1" />
<br />
<br />
<label>Enter Last Name: </label>
<input type="text" name="text2" />
<br />
<br />
<input type="button" name="next1" value="Next" />
<?php
}
function Display2()
{
?>
<form id="form2" action="Multi.php" method="post">
Select Country
<select name="country[]" multiple="multiple">
<option …Run Code Online (Sandbox Code Playgroud)