网站 PAGEVIEW 分析系统 CGI_cgi技术_黑客防线网安服务器维护基地--Powered by WWW.RONGSEN.COM.CN

网站 PAGEVIEW 分析系统 CGI

作者:黑客防线网安网站维护基地 来源:黑客防线网安网站维护基地 浏览次数:0

本篇关键词:PAGEVIEWCGI

目前分析log文件的软件有很多如果一个小的站点只想知道访问量
就大才小用了并且安装这些软件也很麻烦
我写了个分析log的cgi,速度还可以呦 希望大家喜欢

程序代码:
#!/bin/sh
#pv-cgi write by larry lee

# need type
LOGFILE="htm|html|php";
# log file path and filename
LOGACCESS=" /home/webadm/logs/access_log";

# disable filename globbing
set -f
echo Content-type: text/html
echo

echo CGI/1.0 PageView script report:\<br\>
echo \<br\>

echo argc is $#. argv is "$*".
echo \<br\>PageView:

if [ "$#" = "0" ]
then
egrep '('$LOGFILE')' $LOGACCESS | wc -l
fi

if [ "$#" = "1" ]
then
grep "$*" $LOGACCESS | egrep '('$LOGFILE')' | wc -l
fi

echo \<br\>
echo "<script>"
echo "function submit1(){"
echo "var url;"
echo "url='/cgi-bin/pv-cgi?'+document.calendar.day.value+'/'+document.calendar.month.value+'/'+document.calendar.year.value;"
echo "window.location.href=url;"
echo "}"
echo "</script>"
echo "<FORM METHOD=POST name=calendar>"
echo "<select name=year>"
echo "<option value=2002 >2000</option>"
echo "<option value=2001 selected>2001</option>"
echo "<option value=2002 >2002</option>"
echo "</select>"
echo "<select name=month>"
echo "<option value=Jan>1</option>"
echo "<option value=Feb>2</option>"
echo "<option value=Mar>3</option>"
echo "<option value=Apr>4</option>"
echo "<option value=May>5</option>"
echo "<option value=Jun>6</option>"
echo "<option value=Jul>7</option>"
echo "<option value=Aug>8</option>"
echo "<option value=Sep>9</option>"
echo "<option value=Oct>10</option>"
echo "<option value=Nov>11</option>"
echo "<option value=Dec>12</option>"
echo "</select>"
echo "<select name=day>"
echo "<option value=01>1</option>"
echo "<option value=02>2</option>"
echo "<option value=03>3</option>"
echo "<option value=04>4</option>"
echo "<option value=05>5</option>"
echo "<option value=06>6</option>"
echo "<option value=07>7</option>"
echo "<option value=08>8</option>"
echo "<option value=09>9</option>"
echo "<option value=10>10</option>"
echo "<option value=11>11</option>"
echo "<option value=12>12</option>"
echo "<option value=13>13</option>"
echo "<option value=14>14</option>"
echo "<option value=15>15</option>"
echo "<option value=16>16</option>"
echo "<option value=17>17</option>"
echo "<option value=18>18</option>"
echo "<option value=19>19</option>"
echo "<option value=20>20</option>"
echo "<option value=21>21</option>"
echo "<option value=22>22</option>"
echo "<option value=23>23</option>"
echo "<option value=24>24</option>"
echo "<option value=25>25</option>"
echo "<option value=26>26</option>"
echo "<option value=27>27</option>"
echo "<option value=28>28</option>"
echo "<option value=29>29</option>"
echo "<option value=30>30</option>"
echo "<option value=31>31</option>"
echo "</select>"
echo "<INPUT TYPE=button name=select value=Select onclick=submit1()>"
echo "</FORM>"

    黑客防线网安服务器维护方案本篇连接:http://www.rongsen.com.cn/show-133-1.html
网站维护教程更新时间:2008-02-20 05:49:11  【打印此页】  【关闭
我要申请本站N点 | 黑客防线官网 |  
专业服务器维护及网站维护手工安全搭建环境,网站安全加固服务。黑客防线网安服务器维护基地招商进行中!QQ:29769479

footer  footer  footer  footer