PHP

当前位置:首页 > 后端 > PHP

统计网页访问量

<?php require_once &#39;./../source/core/run.php&#39;; $model = &#39;config&#39;; $manplus = 0; $sql = "SELECT value FROM " ....
<?php

require_once './../source/core/run.php';

$model = 'config'; 

$manplus = 0;

$sql = "SELECT value FROM " . DB_PREFIX . $model . " WHERE `key` = 'manplus'"; // 修改查询语句

$rows = $db->fetch_first($sql);

if ($rows) {
    $manplus = intval($rows['value']) + 1; // 将获取的值转换为整数并加1

    $db->update(DB_PREFIX . $model, array('value' => $manplus), "`key` = 'manplus'"); // 更新数据库中的值
}

echo("document.write('" . $manplus . "');");


?>

老版本数据结构

<?php

require_once '../core/run.php';
$manplus = array(
	'manplus' => $config['manplus'] + 1
);
$db->update(DB_PREFIX."config",$manplus,"");

echo("document.write('".$manplus['manplus']."');");


相关内容

文章评论

表情

共 0 条评论,查看全部
  • 这篇文章还没有收到评论,赶紧来抢沙发吧~