我创建了一个表单来接受用户注册。我想要的是在单击提交按钮时使表单的内容显示在另一个页面中 - 这样用户就可以查看表单的详细信息并进行打印。
<form action="sendresult.php" method="post" name="form2" id="form2" autocomplete="on">
<p align="center"><img src="images/headerform.jpg" width="691" height="135"></p>
<p align="center"><strong style="font-size: 24px;">COURSE REGISTRATION FORM
</strong><a href="pageone.html"> - <span style="color: #00F"><strong><em>Click Here to Return to other pages</em></strong></span></a></p>
<p align="center" style="text-align: left; font-size: 16px;">
<label for="LastName">LAST NAME:</label>
<input name="LastName" type="text" id="LastName" form="form2" size="40">
<label for="Firstname">FIRST NAME:</label>
<input name="Firstname" type="text" id="Firstname" form="form2" size="40">
</p>
<p>
<label for="Occupation">OCCUPATION:</label>
<input name="Occupation" type="text" id="Occupation" form="form2" size="100" maxlength="40">
</p>
<p>
<label for="Organisation">ORGANISATION:</label>
<input name="Organisation" type="text" id="Organisation" form="form2" size="97">
</p>
<p>
<label for="Address">ADDRESS:</label>
<input name="Address" type="text" id="Address" form="form2" size="105">
</p>
<p>
<label for="email:">EMAIL:</label>
<input name="email:" type="email" id="email:" form="form2" size="109">
</p>
<p>
<label for="Telephone">TELEPHONE:</label>
<input name="Telephone" type="tel" id="Telephone" form="form2" size="102">
</p>
<u><p><strong>PAYMENT MODE</strong></p></u>
<u><p><strong><span style="color: #F00">Bank Account Details </span></strong></p></u>
<p><strong><span style="color: #F00">Bank - Zenith Bank Nig Plc.</span></strong></p>
<p><strong><span style="color: #F00">Account Name:- Lead Vision Concepts</span></strong></p>
<p><strong><span style="color: #F00">Account Number:- </span></strong></p>
<table width="200">
<tr>
<td><label>
<input name="Bank" type="radio" id="PaymentType_0" form="form2" value="radio">
BANK (ZENITH)</label></td>
</tr>
<tr>
<td><label>
<input name="Direct_Payment" type="radio" id="PaymentType_1" form="form2" value="radio">
DIRECT (CASH)
</label></td>
</tr>
</table>
<p>
<label for="Teller No.">TELLER NO:</label>
<input name="Teller No." type="text" id="Teller No." form="form2" size="40">
<label for="Amount Paid">AMOUNT PAID:</label>
<input name="Amount Paid" type="text" id="Amount Paid" form="form2" autocomplete="on" size="40">
</p>
<p>
<input name="submit" type="submit" id="submit" form ="form2" value="Submit">
<input type="reset" name="reset" id="reset" value="Reset">
</p>
</form>
答案 0 :(得分:0)
在sendresult.php
<?php
foreach($_POST as $key=>$value){
echo "{$key}: {$value}<br />";
}
?>