当我点击以下表单上的提交时,只会将用户名,密码和年龄值发送到registration.php:
<div style="top:250;left:620;position:absolute;"> <H3> Registration : </H3> </div>
<form action="Registration.php" method="Post">
<div style="top:300;left:550;position:fixed;"> <H3> Username </H3> </div><input type="Text" name="UserName" style="position:fixed; top:320; left: 675; width:150px; height:25px"><br>
<div style="top:350;left:550;position:fixed;"> <H3> Password </H3> </div><input type="Password" name="Password" style="position:fixed; top:370; left:675; width:150px; height:25px"><br>
<div style="top:400;left:550;position:fixed;"> <H3> Email Address </H3> </div> <input type="Email" name="Email" style="position:fixed; top:420;left:675;width:150px;height:25px;"><br>
<div style="top:450;left:550;position:fixed;"> <H3> First Name </H3> </div> <input type="Text" name="Fname" style="position:fixed;top:470;left:675;witdh:150px;height:25px;"><br>
<div style="top:500;left:550;position:fixed;"> <H3> Last Name </H3> </div> <input type="Text" name="Lname" style="position:fixed;top:520;left:675;witdh:150px;height:25px;"><br>
<div style="top:550;left:550;position:fixed;"> <H3> Age </H3> </div> <input type="Number" name="Age" style="position:fixed;top:570;left:675;witdh:150px;height:25px;"><br>
<input type="submit" name="fSubmit" value="Registration" style="top:600;left:550;position:fixed;width:100px;height:50px"/>
</form>
有人能说出为什么没有提交其他字段吗?
答案 0 :(得分:3)
;
之后您有input type="text"
。您=
之前没有fSubmit
。
更新:witdh=150px
格式必须为width:150px
。否则,它会中断三个输入字段email
,lastname
和firstname
。
无所事事:top
和left
必须在每个号码后加一个px
字符串。
答案 1 :(得分:0)
第5行
中的HTML可能是错误 <div style="top:400;left:550;position:fixed;"><h3> Email Address </h3></div><input type="Text";name="Email" style="position:fixed; top:420; left:675; width:150px; height:25px;"><br>
您需要删除;
和type="Text"
之间的分号name="Email"
字符。
我认为这可能会破坏您的HTML。
答案 2 :(得分:0)
你可以互换地混合大写和小写字母,你不应该这样。
$email = $_POST['Email'];
$lname = $_POST['Lname'];
echo $Email."<br>";
echo $Lname."<br>";
问题是:$Lname
与$lname
不同,$email
与$Email
不同,原因是PHP中有case sensitivity个变量。
所以,你需要尊重这个规则,即声明&amp;同一案例的参考变量。