源代码如下:
<?php
//功能说明:用户登录界面require("config.inc");
require("dbfunc.inc");
//require("DocMan.inc");if($username != '')
{   
if(Login($username,$password))
{
//InitDocument($user);
header("Location:choose.php");
}
}?>
<html>
<head>
<title>邮政处工程文档管理系统————用户登录</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type=text/css>
<!--
body,td {font-size:9pt;}
-->
</style>
</head><body bgcolor="#FFFFFF"><form action="login.php" method=post>
<table cellspacing=0 cellpadding=0 width=450 height=280 " border=0 align="center">
<tr height="60"><td></td></tr>
<tr height="280"><td><img src="pic/docmis.jpg"></td></tr>
<tr><td height="30" align="center">用户名:<input type=text size=8 name=username style="border:1 solid #c5c5c5;background:#ffffff" onmouseover="this.focus();this.select();">
                    密码:<input type=password size=8 name=password style="border:1 solid #c5c5c5;background:#ffffff" onmouseover="this.focus();this.select();">
<input type="submit" value="确定" style="border:1 solid #c5c5c5;background:#ffffff;font-size:9pt">&nbsp;&nbsp;&nbsp;
</td></tr>
<tr bgcolor=#999999><td height="1"></td></tr>
<tr><td align="center" height="20">版权所有(2001)&nbsp;&nbsp;&nbsp;XXXXXXXXX&nbsp;<img src="pic/citc.bmp" border="0" align="bottom">
<tr><td height="20"></td></tr>
<tr><td height="20"><font color=#ff0000>*如果不能正确登录,请点击<a href="./help/loghelp.html" target=_blank>这里</a>,获得帮助。</font></td></tr>
<tr><td height="20"><font color=#ff0000>*如果查看用户名单,请点击<a href="./help/md.txt" target=_blank>这里</a>,获得帮助。</font></td></tr></td>
</tr>
</table></form>
</body>
</html>

解决方案 »

  1.   

    检查php.ini中的register_globle选项是否打开
    如果为off请改为on
      

  2.   

    我把 register_global打开了还是不行,好像是什么header的问题
      

  3.   

    如果确信username、password两个变量都已经取到了值,则是你的Login()函数有问题。
    最好把这个函数也贴上来,便于检查。
      

  4.   

    是因为我的 Php版本有点高,原来是在低版本上做的,因为session的注册变量的时候没有成功!谢谢各位的热情