以下代码不起作用。 forms.php
和forms.html
是文件名,都保存在根目录中。
错误是“ Undefined variable: POST in C:\wamp\www\forms.php
”。我知道我也没有正确处理多个输入。任何人都可以帮助解决这些问题吗?
<html>
<head>
<title>
Registration for Placement
</title>
</head>
<body>
<h1> Start your Placement process...NOW...</h1>
<form action = "forms.php" method = "POST">
<p> Name <input name = "Name" type = "Text" size = "20" maxlength = "30">
<p> Branch: CSE<input name = "branch" type = "radio" >
ECE<input name = "branch" type = "radio">
MEC<input name = "branch" type = "radio">
<p> Languages Known:English<input name ="lang[]" type = "checkbox" value = "1">
Hindi<input name = "lang[]" type = "checkbox" value = "2">
Tamil<input name = "lang[]" type = "checkbox" value = "3">
<p> State<select name = "state" size = "2">
<option> Jammu and Kashmir
<option> Delhi
<option> Tamil Nadu
<option> M.P
<option> U.P
<option> Maharashtra
</select>
<p> Thanks for submimitting the form
<p><input type = "Submit" value = "enter" >
<input type = "Reset" value = "clear" >
</form>
</body>
</html>
<html>
<head>
<title>Thank You</title>
</head>
<body>
<h1>Thank You</h1>
<p>Thank you for registering. Here is the information you submitted:</p>
<p>Name </p><p><?php echo $POST['Name']; ?></p>
<p>Branch </p><p><?php echo $POST["branch"];?></p>
<p>Lang </p><p><?php echo $POST["lang[0]"];?></p>
<p>STATE </p><p><?php echo $POST["state"];?></p>
</body>
</html>