复制代码代码如下:
session_start();
extract($_POST);
require dirname(apizl_file).'/include/common.inc.php';
$keyadmin="www.bitefu.net";
if($key && $key==$keyadmin)
{
$_SESSION["NowKey"]=$keyadmin;
}
if($_SESSION["NowKey"] && $_SESSION["NowKey"]=$keyadmin){
?>
}else{
?>
}?>
//print_r($_POST);
if(!$addnum && $submit){echo "增加值不能为空!";}
if($submit && $addnum)
{
if($thisid){
$sql="update `".DB_PRE."content_count` set `hits` = `hits` + ".$addnum." where `contentid`='$thisid'";
}else if($idstart){
$sql="update `".DB_PRE."content_count` set `hits` = `hits` + ".$addnum." where `contentid` >= '$idstart'";
if($idend){$sql.=" and `contentid` <= '$idend'";}
}else if($comid || $comstart || $comall){
if($comid){
$sql="update `".DB_PRE."member_info` set `logintimes` = `logintimes` + ".$addnum." where `userid`='$comid'";
}else if($comstart){
$sql="update `".DB_PRE."member_info` set `logintimes` = `logintimes` + ".$addnum." where `userid` >= '$comstart'";
if($comend){$sql.=" and `userid` <='$comend'";}
}else if($comall && $comall==1){
$sql="update `".DB_PRE."member_info` set `logintimes` = `logintimes` + ".$addnum;
}else{$sql='';}
}else if($catid){//
if($catid=="all"){
$sql="update `".DB_PRE."content_count` set `hits` = `hits` + ".$addnum;
}else{
$getid_query=mysql_query("select `contentid` from `".DB_PRE."content` where status=99 ".get_sql_catid($catid));
while($rs=mysql_fetch_assoc($getid_query)){$getid[]=$rs['contentid'];}
$idstr=implode(",",$getid);
$sql="update `".DB_PRE."content_count` set `hits` = `hits` + ".$addnum." where `contentid` in ($idstr)";
}
}else{$sql='';}
}
if($sql && $submit)
{
mysql_query($sql);
echo date("Y-m-d H:i:s")."成功执行了添加操作,共影响数据: ".mysql_affected_rows()." 条";
}else if(!$sql && $submit){
echo "
输入信息有误请确认后再提交!";
}
?>
关键字词: