初学者问题,用$_POST['var']得不到post过来的变量值?

Areslp 2006-09-29 04:08:31
就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"]接收到,请高手指教,谢谢!
...全文
154 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
Areslp 2006-09-29
  • 打赏
  • 举报
回复
谢谢
sandyuk 2006-09-29
  • 打赏
  • 举报
回复
text/plain: 窗体数据以纯文本形式进行编码,其中不含任何控件或格式字符。
Areslp 2006-09-29
  • 打赏
  • 举报
回复
好了,能告诉我这是为什么吗
keenx 2006-09-29
  • 打赏
  • 举报
回复
<form action="./login/auth.php" method="post" enctype="text/plain">
把enctype="text/plain"去掉
Areslp 2006-09-29
  • 打赏
  • 举报
回复
对了,sizeof($_POST)是0
iasky 2006-09-29
  • 打赏
  • 举报
回复
应该可以得到的阿

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧