挑战最棒的留言本的源码(三)
-
原创
-
2016-06-21 09:03:17
439浏览
action.php文件
require('config.php');
$action=$arr_request['action'];
$key_liuyan=$arr_request['key_liuyan'];
if (!isset($PHP_AUTH_USER))
{
Header('WWW-Authenticate:Basic realm="管理留言"');
Header('HTTP/1.0 401 Unauthorized');
echo '需要受权,你没有这权限!
';
echo '单击刷新来重试.
';
exit;
}
else
{
if (strlen($PHP_AUTH_USER)!=0)
{
if ($action=="delete")
echo "对不起,你没有删除留言的权限!!!
";
else if ($action="huifu")
echo "对不起,你暂时还不能恢复,现在只有版主有这权限!!!
";
else
echo "对不起,你没有管理留言本的权限!!!";
exit;
}
$pass=$PHP_AUTH_PW;
// echo $pass;
$result=0;
while($pass%10!=0)
{
$result=$result+$pass%10;
$pass=($pass-$pass%10)/10;
// echo $result;
// echo "
";
}
$tt=$result*222;
//echo $tt;
if (!checkpass($tt,$action,$db_name,$table_name_control,$id_link))
{
if ($action=="delete")
echo "对不起,你没有删除留言的权限!!!
";
else if ($action="huifu")
echo "对不起,你暂时还不能恢复,现在只有版主有这权限!!!
";
else
echo "对不起,你没有管理留言本的权限!!!";
exit;
}
}
if ($action=="delete")
{
//printf("delete");
//echo $key_liuyan;
$str_sql="delete from $table_name where key_liuyan=$key_liuyan";
$re=mysql_db_query($db_name,$str_sql,$id_link);
if (!$re)
{
echo "删除出错";
}
else
{
echo "成功删除";
echo "";
echo "发表文章";
echo "";
echo "";
echo "
";
echo "";
}
}
else if ($action=="huifu")
{
//printf("huifu");
// echo $key_liuyan;
?>
}
else if ($action=="ok")
{
$key=$arr_request['key'];
$huifuold=$huifu;
$time=date('Y/m/d H:i:s');
$time='('.$time . ')
';
$huifuold=$time .$huifuold ;
$huifu_ok=computer_message($huifuold,$hang_zifu_number);
if (strlen($key)==0)
{ echo "error";
exit;
}
$str_sql="update $table_name set huifu_biaozi=1,
huifu='$huifu_ok' where key_liuyan=$key";
// echo $str_sql;
$re=mysql_db_query($db_name,$str_sql,$id_link);
if (!$re)
{
echo "更新出错";
}
else
{
echo "回复成功";
echo "";
echo "发表文章";
echo "";
echo "";
echo "
";
echo "";
exit;
}
}
else
printf("error");
?>
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。