3个回答
展开全部
先给储存相应文章的数据表增加一个记录访问量的字段。
1, 可以每访问一次,字段数量加一,但是这样会不准确,因为只要刷新一下,就会记录一下。
2, 为了防止上面的情况发生,可以记录访问者的IP地址,重复的IP地址访问,只记录一次。
3, 但是,一个IP地址,只记录一次,也有问题,比如,一个局域网,多个访问者,共用一个IP地址,这样也会记录不准确。所以最好,一个IP地址一定时间内访问记录一次。这样相对好一点。
4, 不过,即使记录IP地址,但是也有可能有恶意的用户通过切换IP,或者通过刷票软件来刷访问量。这些问题,还需要更深的研究一下,怎么应对。
比如:
<?php
$ip = $_SERVER['REMOTE_ADDR'];
//循环对比数据表中储存的IP,如果IP存在,不再记录
$query = mysql_query("select * contetns where ip = '".$ip."'");
if(mysql_num_rows($query) > 0){
//IP存在
}else{
//记录访问量
}
?>
1, 可以每访问一次,字段数量加一,但是这样会不准确,因为只要刷新一下,就会记录一下。
2, 为了防止上面的情况发生,可以记录访问者的IP地址,重复的IP地址访问,只记录一次。
3, 但是,一个IP地址,只记录一次,也有问题,比如,一个局域网,多个访问者,共用一个IP地址,这样也会记录不准确。所以最好,一个IP地址一定时间内访问记录一次。这样相对好一点。
4, 不过,即使记录IP地址,但是也有可能有恶意的用户通过切换IP,或者通过刷票软件来刷访问量。这些问题,还需要更深的研究一下,怎么应对。
比如:
<?php
$ip = $_SERVER['REMOTE_ADDR'];
//循环对比数据表中储存的IP,如果IP存在,不再记录
$query = mysql_query("select * contetns where ip = '".$ip."'");
if(mysql_num_rows($query) > 0){
//IP存在
}else{
//记录访问量
}
?>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
网站流量统计分析系统,如浏览量、点击率等
phpmv2
......\.project
......\CHANGELOG
......\config.inc.php
......\core
......\....\admin
......\....\.....\AdminDbConfig.class.php
......\....\.....\AdminGeneralConfig.class.php
......\....\.....\AdminGroup.class.php
......\....\.....\AdminHelpPagename.class.php
......\....\.....\AdminIndex.class.php
......\....\.....\AdminPluginConfig.class.php
......\....\.....\AdminServerInfo.class.php
......\....\.....\AdminSiteCookieExclude.class.php
......\....\.....\AdminSiteGeneral.class.php
......\....\.....\AdminSiteIpExclude.class.php
......\....\.....\AdminSiteJavascriptCode.class.php
......\....\.....\AdminSiteNewsletters.class.php
......\....\.....\AdminSitePartners.class.php
......\....\.....\AdminSitePdfConfig.class.php
......\....\.....\AdminSiteUrls.class.php
......\....\.....\AdminUpdate.class.php
......\....\.....\AdminUrlRedirectionGenerate.class.php
......\....\.....\AdminUser.class.php
......\....\datas
......\....\.....\browserFamilies.php
......\....\.....\browsers.php
......\....\.....\countryList.php
......\....\.....\countryMap.php
......\....\.....\fontList.php
......\....\.....\ispCountryList.php
......\....\.....\osLists.php
......\....\.....\pagesGap.php
......\....\.....\searchEngines.php
......\....\.....\timeGap.php
......\....\forms
......\....\.....\Form.class.php
......\....\.....\FormDbConfig.class.php
......\....\.....\FormGeneralConfig.class.php
......\....\.....\FormGroup.class.php
......\....\.....\FormLogin.class.php
......\....\.....\FormPluginConfig.class.php
......\....\.....\FormSiteGeneral.class.php
......\....\.....\FormSiteIpExclude.class.php
......\....\.....\FormSiteNewsletter.class.php
......\....\.....\FormSitePartner.class.php
......\....\.....\FormSitePdfConfig.class.php
......\....\.....\FormSiteUrls.class.php
......\....\.....\FormUser.class.php
......\....\include
......\....\.......\AdminModule.class.php
......\....\.......\ApplicationController.php
......\....\.......\Archive.class.php
......\....\.......\Archive.functions.php
......\....\.......\ArchiveCategory.class.php
......\....\.......\ArchiveDay.class.php
......\....\.......\ArchiveEmpty.class.php
......\....\.......\ArchiveMonth.class.php
......\....\.......\ArchivePeriod.class.php
......\....\.......\ArchiveTable.class.php
......\....\.......\ArchiveWeek.class.php
......\....\.......\ArchiveYear.class.php
......\....\.......\common.functions.php
......\....\.......\commonDB.php
......\....\.......\Cookie.class.php
......\....\.......\DataModel.class.php
......\....\.......\Date.class.php
......\....\.......\fpdf
......\....\.......\....\myFpdf.php
......\....\.......\....\myFpdfChinese.php
......\....\.......\functions.php
......\....\.......\graphs
......\....\.......\......\Graph3DPie.class.php
......\....\.......\......\GraphBarAndCurb.class.php
......\....\.......\......\GraphSplitBar.class.php
......\....\.......\......\GraphVerticalBar.class.php
......\....\.......\......\PmvGraph.class.php
......\....\.......\InstallModule.class.php
......\....\.......\installSql.php
......\....\.......\Lang.class.php
......\....\.......\Logs.functions.php
......\....\.......\MenuDefinition.php
......\....\.......\Module.class.php
......\....\.......\myMailer.class.php
......\....\.......\PdfConfig.class.php
......\....\.......\PdfConfigDb.class.php
......\....\.......\PmvConfig.class.php
......\....\.......\Request.class.php
......\....\.......\Site.class.php
......\....\.......\SiteConfigDb.class.php
......\....\.......\smarty_plugins
......\....\.......\..............\compiler.pmv_data_array.php
......\....\.......\..............\modifier.mb_truncate.php
......\....\.......\..............\modifier.print_percent.php
......\....\.......\..............\modifier.time.php
......\....\.......\..............\modifier.time_visit.php
......\....\.......\..............\modifier.translate.php
......\....\.......\Str.class.php
......\....\.......\TemplateEngine.php
......\....\.......\updateLangFiles.php
phpmv2
......\.project
......\CHANGELOG
......\config.inc.php
......\core
......\....\admin
......\....\.....\AdminDbConfig.class.php
......\....\.....\AdminGeneralConfig.class.php
......\....\.....\AdminGroup.class.php
......\....\.....\AdminHelpPagename.class.php
......\....\.....\AdminIndex.class.php
......\....\.....\AdminPluginConfig.class.php
......\....\.....\AdminServerInfo.class.php
......\....\.....\AdminSiteCookieExclude.class.php
......\....\.....\AdminSiteGeneral.class.php
......\....\.....\AdminSiteIpExclude.class.php
......\....\.....\AdminSiteJavascriptCode.class.php
......\....\.....\AdminSiteNewsletters.class.php
......\....\.....\AdminSitePartners.class.php
......\....\.....\AdminSitePdfConfig.class.php
......\....\.....\AdminSiteUrls.class.php
......\....\.....\AdminUpdate.class.php
......\....\.....\AdminUrlRedirectionGenerate.class.php
......\....\.....\AdminUser.class.php
......\....\datas
......\....\.....\browserFamilies.php
......\....\.....\browsers.php
......\....\.....\countryList.php
......\....\.....\countryMap.php
......\....\.....\fontList.php
......\....\.....\ispCountryList.php
......\....\.....\osLists.php
......\....\.....\pagesGap.php
......\....\.....\searchEngines.php
......\....\.....\timeGap.php
......\....\forms
......\....\.....\Form.class.php
......\....\.....\FormDbConfig.class.php
......\....\.....\FormGeneralConfig.class.php
......\....\.....\FormGroup.class.php
......\....\.....\FormLogin.class.php
......\....\.....\FormPluginConfig.class.php
......\....\.....\FormSiteGeneral.class.php
......\....\.....\FormSiteIpExclude.class.php
......\....\.....\FormSiteNewsletter.class.php
......\....\.....\FormSitePartner.class.php
......\....\.....\FormSitePdfConfig.class.php
......\....\.....\FormSiteUrls.class.php
......\....\.....\FormUser.class.php
......\....\include
......\....\.......\AdminModule.class.php
......\....\.......\ApplicationController.php
......\....\.......\Archive.class.php
......\....\.......\Archive.functions.php
......\....\.......\ArchiveCategory.class.php
......\....\.......\ArchiveDay.class.php
......\....\.......\ArchiveEmpty.class.php
......\....\.......\ArchiveMonth.class.php
......\....\.......\ArchivePeriod.class.php
......\....\.......\ArchiveTable.class.php
......\....\.......\ArchiveWeek.class.php
......\....\.......\ArchiveYear.class.php
......\....\.......\common.functions.php
......\....\.......\commonDB.php
......\....\.......\Cookie.class.php
......\....\.......\DataModel.class.php
......\....\.......\Date.class.php
......\....\.......\fpdf
......\....\.......\....\myFpdf.php
......\....\.......\....\myFpdfChinese.php
......\....\.......\functions.php
......\....\.......\graphs
......\....\.......\......\Graph3DPie.class.php
......\....\.......\......\GraphBarAndCurb.class.php
......\....\.......\......\GraphSplitBar.class.php
......\....\.......\......\GraphVerticalBar.class.php
......\....\.......\......\PmvGraph.class.php
......\....\.......\InstallModule.class.php
......\....\.......\installSql.php
......\....\.......\Lang.class.php
......\....\.......\Logs.functions.php
......\....\.......\MenuDefinition.php
......\....\.......\Module.class.php
......\....\.......\myMailer.class.php
......\....\.......\PdfConfig.class.php
......\....\.......\PdfConfigDb.class.php
......\....\.......\PmvConfig.class.php
......\....\.......\Request.class.php
......\....\.......\Site.class.php
......\....\.......\SiteConfigDb.class.php
......\....\.......\smarty_plugins
......\....\.......\..............\compiler.pmv_data_array.php
......\....\.......\..............\modifier.mb_truncate.php
......\....\.......\..............\modifier.print_percent.php
......\....\.......\..............\modifier.time.php
......\....\.......\..............\modifier.time_visit.php
......\....\.......\..............\modifier.translate.php
......\....\.......\Str.class.php
......\....\.......\TemplateEngine.php
......\....\.......\updateLangFiles.php
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
应该会有显示。不用你自己统计的吧?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询