我刚刚制作了一个基本的表单页面,通过 Aptana、WAMP 和一个基本的 1and1 托管页面,我无法让表单字段通过 $_POST 超全局。
这是 index.html 页面:
<html>
<head>
</head>
<body>
<p>Type in the areas</p>
<form action="keywords.php" method="POST">
<label for="Area1"> 1:</label>
<input type="text" id="Area1" name="first area /"><br />
<label for="Area1"> 2:</label>
<input type="text" id="Area2" name="second area /"><br />
<label for="Area1"> 3:</label>
<input type="text" id="Area3" name="third area /"><br />
<label for="Area1"> 4:</label>
<input type="text" id="Area4" name="fourth area /"><br />
<label for="Area1"> 5:</label>
<input type="text" id="Area5" name="fifth area /"><br />
<label for="Area1"> 6:</label>
<input type="text" id="Area6" name="sixth area /"><br />
<label for="Area1"> 7:</label>
<input type="text" id="Area7" name="seventh area /"><br />
<label for="Area1"> 8:</label>
<input type="text" id="Area8" name="eighth area /"><br />
<input type="submit" value="Run" name="Run">
</form>
</body>
</html>
?>
传递给keywords.php
<?php
if(isset($_POST['submit'])){
echo "test";
$area1 = $_POST['Area1'];
$area2 = $_POST['Area2'];
$area3 = $_POST['Area3'];
$area4 = $_POST['Area4'];
$area5 = $_POST['Area5'];
$area6 = $_POST['Area6'];
$area7 = $_POST['Area7'];
$area8 = $_POST['Area8'];
echo $area1;
}
?>
亲爱的主,我做错了什么。要温柔。PHP 5.3.4