求助! php.iniregister_globals = On 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 数据库已经有了,LY表里面有内容.我到C:\WINNT\Temp 下也看到有session很多的文件. 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); ?> 不好意思,应该是admin.htm,不是admin.php.不是"先进admin.php,后进index.php" 直接输入:http://127.0.0.1/freewind/index.php就可以进入index.php现在可以在:http://127.0.0.1/freewind/index.php?ly=1留言了,但在admin.htm填了管理员帐号和密码后,按:go,却进不了index.php页,说:你没有管理员权力" 这是密码不对嘛,echo $in_admin;echo $in_password;试试看,是不是和你数据库里的用户名和密码一样! 紧急!紧急!mysql 查询失败很多是怎么回事? mysql中设置外键的问题 关于MYSQL,请诸位大侠踊跃发言,偶是菜鸟没有很多分散,怯怯请原谅啦:) 请问有什么MySQL的建表,建库的图形化工具吗?或者是类似PowerDesigner的建模工具 这个sql语句怎么写?(在mysql中) 来得分吧!!请教高手,sets到底是什么? 如何清空记录? 话说mysql...... 求一个联表sql LEFT JOIN关联查询出来的数据会成倍增加?大神指点。 怎么解决: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;
试试看,是不是和你数据库里的用户名和密码一样!