【发布时间】:2014-11-17 04:26:30
【问题描述】:
尝试使用 php.ini 提交表单。当表单完成并点击“提交”时,我希望加载一个新网页,显示客户的所有凭据和选择以及客户的注册号。我想使用“post”方法使用外部 .php 文件创建新页面。
这是我的表格:
<form name="form1" method="post" action="confirmation.php">
What is your name? <input type="text" name="fullname" size="25" /><br />
Your address: <input type="text" name="address" size="25" /><br />
Your email: <input type="text" name="email" size="25" /><br />
Your phone number (home/mobile): <input type="text" name="phonenumber" size="25" />
What type of apartment are you willing to rent?:<br />
<input type="checkbox" name="1Bedroom" /> 1 bedroom<br />
<input type="checkbox" name="2Bedroom" /> 2 bedroom<br />
<input type="checkbox" name="3Bedroom" /> 3 bedroom<br />
Rental Type:<br />
<input type="radio" name="type" value="weekly" /> Weekly <br />
<input type="radio" name="type" value="monthly" /> Monthly <br />
Starting Date for Rental <input type="date" name="startingdate" size="25" />
<br />
<input type="submit" value="Submit Form" />
</form>
到目前为止我已经尝试过了(没有公寓类型、租赁类型、开始日期):
<?php
echo $_POST["fullname"]; <br />
echo $_POST["address"]; <br />
echo $_POST["email"]; <br />
echo $_POST["phonenumber"]; <br />
?>
但是来自表单的输入没有在新窗口中出现。
【问题讨论】:
-
你能展示一下你的
-
我将我的php文件命名为confirmation.php @binderbound
-
你的意思是在一个新窗口中,你只想打印表单中的值?
-
是的,将打开一个新窗口,其中包含表单中的值和选项以及注册号。最终我想创建一个文本文件来存储客户端的所有信息。 @Rizier123