注册 登录
编程论坛 PHP技术论坛

[求助]这到底出什么问题了

ninggang 发布于 2007-07-19 23:38, 1650 次点击
Parse error: syntax error, unexpected $end in D:\php\apache\Apache2\htdocs\a\users.php on line 43
报错
望有经验的朋友求助
9 回复
#2
谁与争疯2007-07-19 23:43
代码呢?小姐?兄弟?
#3
ninggang2007-07-19 23:51
文件test10.html的代码
<html>
<head>
</head>
<body>
<form method=post action="users.php">
<center>
用户名:<input type=text name="name" size=16><br>
密 码:<input type=password name="pwd" size=16><p>
<input type=submit name="normal" value="登陆">
<input type=submit name="newuser" value="新用户注册">
</center>
</form>
</body>
</html>
文件users.php的代码
<html>
<head>
<body>
<?php

$connect_id=mysql_connect("127.0.0.1","root","19841024");
mysql_select_db("users",$connect_id);
//点机登陆按钮用户登陆
if($normal)
{ if(empty($name)||empty($pwd))
{ //如果用户名或密码为空
echo("用户名和密码b不能为空!");
}
//下面进行用户名和密码的校验
$result=mysql_query("select *from users where name='$name'");
//下面检测用户名
if(mysql_num_rows($result)!=1)
{ echo("用户名不存在!");
}
//检测密码
else
{ $arruser=mysql_fetch_array($result);
if($arruser["password"]!=$pwd)
{ echo("密码错误!");
}
else
{ echo("<title>用户登陆成功!</title>");

}
}
mysql_close();
exit();
?>
</body>
</head>
</html>
#4
谁与争疯2007-07-19 23:54

users.php on line 43

#5
ninggang2007-07-20 00:13
我知道报错的位置,就是最后一行
可是。。。。
#6
谁与争疯2007-07-20 00:19
users.php
我怎么看,都没有43行这么多啊?
#7
myfor2007-07-20 11:33
<html>
<head>
<body>
<?php

$connect_id=mysql_connect("127.0.0.1","root","19841024");
mysql_select_db("users",$connect_id);
//点机登陆按钮用户登陆
if($normal)
{ if(empty($name)||empty($pwd))//与这里的配套
{ //如果用户名或密码为空
echo("用户名和密码b不能为空!");
}
//下面进行用户名和密码的校验
$result=mysql_query("select *from users where name='$name'");
//下面检测用户名
if(mysql_num_rows($result)!=1)
{ echo("用户名不存在!");
}
//检测密码
else
{ $arruser=mysql_fetch_array($result);
if($arruser["password"]!=$pwd)
{ echo("密码错误!");
}
else
{ echo("<title>用户登陆成功!</title>");

}
}
}
mysql_close();
exit();
?>
</body>
</head>
</html>
#8
谁与争疯2007-07-20 12:27
缺少了括号啊。
我们真够粗心的。
#9
ninggang2007-07-20 13:09
呵呵,非常感谢你,爱死你了
#10
可可熊2007-07-26 22:04
自己仔细看看应该能看出来.
1