|
等 级:长老 |
经 验 值:1295 |
魅 力 值:186 |
龙 币:2783 |
积 分:1445.9 |
注册日期:2001-12-02 |
|
|
|
请教高手帮我看看程序呀
本人初学做网页就卡住了,知道这里高手很多,特来请教,下面的程序看上去很简单,怎么我运行以后,点按钮,什么反应都没有呢?帮我看看是哪错了。先谢过了。
<?
if ($register=="yes")
{
if ($userid!="")
{
$db_id=mysql_connect("localhost", "root", "123456");
//判断用户名和密码是否在正确
$result=mysql_db_query("work","SELECT userid,password FROM userinfo WHERE userid='$userid' and password='$passwd'");
//数据库名是work,表名是userinfo
$num=mysql_numrows($result);
mysql_close($db_id);
if($num>0)
{
echo "<center>登录成功!</center><br>";
}
else echo "<center><font color=red>登录失败!请检查用户名和密码!</font></center><br>";
}
}
?>
<html>
<head>
<title>用户登录</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#EBEBEB" topmargin="1">
<form action="right.php" method="post">
<font size="1" color=Black>
<?
$cweekday=array("星期日","星期一","星期二","星期三","星期四","星期五","星期六");
$now=getdate(time());
$cur_wday=$now['wday'];
$showtime=date("Y年m月d日 $cweekday[$cur_wday]");
print $showtime
?>
用户名<input name="userid" type="text" maxlength="8" size="10">
密码<input name="passwd" type="password" maxlength="8" size="10">
<input name="register" type="hidden" value="yes">
<input class=input name="submit" type="submit" value="登录">
尚未注册或忘记密码请与管理员联系
</font>
<hr color="Olive">
</form>
</body>
</html>
|
|
|
|