我被困在一个无法将html输入类型的值获取到php的地方。我正在使用Aptana开发一个网站。
我在stackoverflow也没有找到任何有效的答案。
我只是在浏览器中查看HTML文件,有问题吗?
我的代码如下:
FirstWebPage.html
<!DOCTYPE html>
<html>
<body bgcolor="#ffffff">
<h1 style="font-size:44pt" align="center">myPersonals.com</h1>
<h2 align="center">Welcome to your personal data center </h2>
<form action="welcome.php" method="get">
<div align="center">
<h3>Login</h3>
<input style="height:20px; width:200px; font-size:14pt" type="text" name="email" placeholder="Email" style="#b8b9c8">
<br>
<br>
<input style="height:20px; width:200px; font-size:14pt" type="text" name="password" placeholder="Password">
<br>
<br>
<select name="sex" style="height:30px; width:200px; font-size:14pt">
<option value="m">Male</option>
<option value="f">Female</option>
</select>
<br>
<br>
<input style="height:30px; width:200px; font-size:14pt" type="submit" value="Submit">
<br>
</div>
</form>
<a href="bigDB.jpg">
<img src="smallDB.jpg">'
</a>
</body>
</html>
这是我的福利。php
<html>
<body>
Welcome php Surendra Reddy your email id is <?php echo $_GET['email']; ?><br>
and you are password is <?php echo $_GET['password']; ?><br>
and your gender id <?php echo $_GET["sex"]; ?>
</body>
</html>
但它并没有打印这些值。
///如果您使用post而不是获取,则会起作用
我用post-and-get方法尝试了你的代码,运行得很好,你需要在examplep中尝试代码,或者与aptana不同的东西,代码可以工作,可以是关于aptana服务器配置的