php.ini
register_globals = On
register_globals = On
解决方案 »
- 求时间重叠
- 大家帮帮我,再不行就卷铺盖回家了
- MYSQL数据导入问题
- mysql一直连不上jdbc驱动?
- 急!50分!!! 求一条sql语句
- 存储过程总提示错误...
- 实现局域网:一台服务器A, 多个客户端B1 , B2, B3 , B4
- 【怎么写】删除父表中id=2704的行且同时删除子表中满足这条件的行
- mysql-5.6.16-win32安装后show databases看不到mysql缺省数据库?
- mysql的单个数据库物理迁移出现ERROR 1146 (42S02): Table 'xx' doesn't exist
- 怎么解决:configure:eror:no size for char type?(急阿)
- linux下的MyODBC怎么用?
admin.php在index.php前面的,先进admin.php,后进index.php
现在把register_globals諼成是on后,变成进不了http://127.0.0.1/freewind/index.php了,说:"你没有管理员权力"呀!index.php原码如下:
<?
//此程序为主程序,用于列出留言内容,和实现删除、修改的管理功能.
include("connect.inc.php");
if ($load == "Go" ) {
if (($in_admin == "") or ($in_password == "")){
echo "<center>没有填完</center>";
exit;
}
session_save_path($session_path);
$query = "select * from $admin_table";
$result = mysql_query($query);
$number = mysql_num_rows($result);
$row = mysql_fetch_array($result);
$admin = $row[admin];
$password = $row[password];
if ($admin == $in_admin and $password == $in_password) {
$right_admin = "$admin";
$right_password = "$password";
session_register("right_admin");
session_register("right_password");
}else {
mysql_close($connect);
die("你没有管理员权力");
}
}
require("check_session.inc.php");
if ($delete){
check_session($right_admin,$right_password,1,$admin_table);
$delete_ly_query = "select * from $table ";
$result = mysql_query($delete_ly_query);
MYSQL_QUERY("DELETE from $table where (id='$delete') ");
mysql_close($connect);
}
include("form.inc.php");
if (!isset($page)){
$page=0;
}
include("page.inc.php");
if ($keyword){
$query = "select * from $table order by id desc";
}else{
$query = "select * from $table order by id desc limit $page,$limit";
}
$result = mysql_query($query);
$re_total = mysql_num_rows($result);
if ($re_total == 0) {
print "<br><center>暂时没有留言</center>";
exit;
mysql_close($connect);
}
elseif ($re_total>0){
check_session($right_admin,$right_password,0,$admin_table);
$i=0;
while ($i < $re_total){
$row = mysql_fetch_array($result);
$name = stripslashes($row[name]);
$content = stripslashes($row[content]);
$email = stripslashes($row[email]);
$homepage = stripslashes($row[homepage]);
$color = $row[color];
$time =$row[time];
$pic = $row[pic];
$id = $row[id];
if ($keyword) {
////////////////////////////////// 此句设关键字对大小写敏感 ////////////////////////////////////////////////
////if ($content !=ereg_replace($keyword,"",$content)) or ($name !=eregi_replace($keyword,"",$name) { ///
if (($content !=eregi_replace($keyword,"",$content)) or ($name !=eregi_replace($keyword,"",$name))) {
include("list.inc.php");
}
}
else {
include("list.inc.php");
}
$i++;
}
}
include("page.inc.php");
mysql_close($connect);
?>
就可以进入index.php
现在可以在:http://127.0.0.1/freewind/index.php?ly=1留言了,但在admin.htm填了管理员帐号和密码后,按:go,
却进不了index.php页,说:你没有管理员权力"
echo $in_admin;
echo $in_password;
试试看,是不是和你数据库里的用户名和密码一样!