初学者问题,用$_POST['var']得不到post过来的变量值?
就2个文件,一个index.php,在根目录下面:
<?php
/*
* Created on 2006-9-29
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
echo "登录";
?>
<form action="./login/auth.php" method="post" enctype="text/plain">
用户名:<input type="text" name="username" value="" size="10" maxlength="40"/> <br>
密码: <input type="password" name="password" size="10" maxlength="40"/> <br>
<br>
<input type="submit" name="submit" value="提交"/>
</form>
就一个form
还有个文件在跟目录下的login文件夹下,auth.php
<?php
/*
* Created on 2006-9-29
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
extract($_POST);
print sizeof($_POST);
$username=$_POST["username"];
$password=$_POST["password"];
print "$username<br>$password";
?>
但是接收不到值,把form的post改成get的话,可以用$_GET["var"]接收到,请高手指教,谢谢!