<?php@session_start(); require_once './module/t_doctor.inc';
$t_doctor = new t_doctor();
if(isset($Submit)){     $sql="select * FROM t_doctor WHERE docname='".$username."' AND password='".$password."' ";
$userInfo = $t_doctor->_execute($sql, "getRow");
if(!is_array($userInfo)){
      AlertMsg("用户名或密码错误!");
  GotoWeb("login.php");
  die();
    }else{
      $_SESSION['s_userid'] =   $userInfo['id'];
          $_SESSION['s_password'] = $userInfo['password'];
          $_SESSION['s_name'] =     $userInfo['name'];
  $_SESSION['s_docname'] =  $userInfo['docname'];
          $_SESSION['s_docid'] =    $userInfo['id'];
  $_SESSION['s_kefuid'] =   $userInfo['id'];
  if($userInfo['type'] == "")
     $_SESSION['s_type']  =    "D"; //表示医生信息
              else
     $_SESSION['s_type']  = $userInfo['type'];
  AlertMsg("登陆成功!");
  GotoWeb("./index.php");
      die();
}

}?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head><body>
<form name="form1" method="post" action="1.php">
<table width="280" height="96" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#999999">
<tr>
<td colspan="2" align="center" bgcolor="#ffffff">用户登录</td>
</tr>
<tr>
<td align="right" bgcolor="#ffffff">用户名:</td>
<td align="left" bgcolor="#ffffff"><input name="username" type="text"  value="" size="20"></td>                         
</tr>
<tr>
<td align="right" bgcolor="#ffffff">口令:</td>
<td align="left" bgcolor="#ffffff"><input name="password" type="password"  size="20"></td>                         
</tr>
<td colspan="2" align="center" bgcolor="#ffffff">
<input name="Submit" type="submit"value="登陆"> 
                                <input name="cs" type="reset" value="取 消" >
</td>
</tr>
                           
</table>
</form>
</body>
</html>点登陆没反应,不允许if语句
恳请高手改正

解决方案 »

  1.   


    那包含文件和session判断那段去掉,你看下有反应不
    <?php@session_start();  ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    </head><body>
    <form name="form1" method="post" action="1.php">
    <table width="280" height="96" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#999999">
    <tr>
    <td colspan="2" align="center" bgcolor="#ffffff">用户登录</td>
    </tr>
    <tr>
    <td align="right" bgcolor="#ffffff">用户名:</td>
    <td align="left" bgcolor="#ffffff"><input name="username" type="text" value="" size="20"></td>   
    </tr>
    <tr>
    <td align="right" bgcolor="#ffffff">口令:</td>
    <td align="left" bgcolor="#ffffff"><input name="password" type="password" size="20"></td>   
    </tr>
    <td colspan="2" align="center" bgcolor="#ffffff">
    <input name="Submit" type="submit"value="登陆">  
      <input name="cs" type="reset" value="取 消" >
    </td>
    </tr>
        
    </table>
    </form>
    </body>
    </html>
      

  2.   

    在 if(isset($Submit)){ 之前加上
    extract($_POST);
      

  3.   

    <input name="Submit" type="submit"value="登陆">  少了个空格,应该是<input name="Submit" type="submit" value="登陆">