一江春水向东流

做一个有思想的人,期待与每一位热爱思考的人交流,您的关注是对我最大的支持。

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  44 随笔 :: 139 文章 :: 81 评论 :: 0 Trackbacks

<html>
<head>
<title>用户登录</title>
</head>
<body alink="#FF0000" link="#000099" vlink="#CC6600" topmargin="8" leftmargin="0" bgColor="#FFFFFF">
<br>
<?
 require("mysql.class.php");
 if($userid!="")
 {
  $db->dbconnect($db->dbbase,0);
  //判断用户名和密码是否在正确
  $strSql="select * from user where userid='$userid' and password='$password'";
  $result=$db->dbquery($strSql,$database);
  $num=$db->dbgetnum($result);
  //$num=mysql_numrows($result);
  $db->dbclose();
  //mysql_close($myconn);
  if($num>0)
  {
   echo "<center>登录成功!</center><br>";
  }
  else echo "<center><font color=red>登录失败!请检查用户名和密码!</font></center><br>";
 }
 else
 {
  echo "<center>请输入用户名和密码登录!</center>"
?>
<form action="<?echo $PHP_SELF?>" method="post">
<table cellspacing=0 bordercolordark=#FFFFFF width="60%" bordercolorlight=#000000 border=1 align="center" cellpadding="2">
  <tr bgcolor="#6b8ba8" style="color:FFFFFF">
    <td width="100%" align="center" valign="bottom" height="19" colspan="3">用户登录</td>
  </tr>
  <tr>
    <td width="30%" align="center">用户名:</td>
    <td width="70%" align="center"><input type="text" name="userid" size="20" maxsize="20"></td>
  </tr>
  <tr>
    <td width="30%" align="center">密  码:</td>
    <td width="70%" align="center"><input type="password" name="password" size="20" maxsize="20"></td>
  </tr>
  <tr>
    <td width="100%" align="center" colspan="2"><input type="submit" value="登录"></td>
  </tr>
</table>
</form>
<?
 }
?>
</body>
</html>


 

posted on 2008-05-24 20:16 allic 阅读(227) 评论(0)  编辑  收藏 所属分类: PHP+MySQL开发

只有注册用户登录后才能发表评论。


网站导航: