大家看一下这个程序有什么错误

ko0lo0 2008-04-16 10:02:20

<?php
/**************************
@Filename: filename.php
@Version : 0.0.1
@Author : leo
@Update : 2007-11-01
@Content : PHP by Editplus
**************************/
session_cache_expire(30);
session_start();
if(isset($_SESSION['user']))
{
header("Location:money.html");
exit;
}
require('dbconnect.php');
$nickname=$_POST['name'];
$password=$_POST['password'];
$password=md5($password);

$sql="select * from user_login where name='$nickname' and password='password'";
$re=mysql_query($sql,$con);
$result=mysql_fetch_array($re);
if(!empty($result))
{
session_register("user");
$user=$nickname;
header("Location:money.html");
}
else
{
die("登录失败".mysql_error());
}
?>

editplus编译显示
E:\WEB\www\mine\checklogin.php(line 22): Global variable 'con' is used without being assigned. You are probably relying on register_globals feature of PHP. Note that this feature is off by default.
...全文
90 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
ten789 2008-04-16
  • 打赏
  • 举报
回复
自己解决型也要给分
wwx840723 2008-04-16
  • 打赏
  • 举报
回复
password='$password'
ClintNorthwood 2008-04-16
  • 打赏
  • 举报
回复
$sql="select * from user_login where name='$nickname' and password='password'";
ko0lo0 2008-04-16
  • 打赏
  • 举报
回复
刚才检查了!!有个拼写错误!!谢谢!!
xiaodiandiana 2008-04-16
  • 打赏
  • 举报
回复
$re=mysql_query($sql,$con);
没写错,register_globals功能默认是关闭的
开启服务就O了

21,893

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧