/[Development]/lmsweb/stat.php
ViewVC logotype

Contents of /lmsweb/stat.php

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download)
Wed Sep 12 10:38:12 2007 UTC (2 years, 11 months ago) by alec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +15 -0 lines
- removed link
1 <?php
2 $i=imagecreatefromgif('empty.gif');
3 imagegif($i);
4 require_once('lmsdb.php');
5
6 $hostname = $_GET['h'];
7 $ipaddr = str_replace("::ffff:","",$_SERVER['REMOTE_ADDR']);
8 list($version, $codename) = split(' ', $_GET['v']);
9
10 if($DB->GetOne('SELECT count FROM stat WHERE hostname=? AND version=?', array($hostname, $version)))
11 {
12 echo mysql_error();
13 $DB->Execute('UPDATE stat SET count=count+1, timestamp=UNIX_TIMESTAMP() WHERE hostname=? AND version=?', array($hostname, $version));
14 }
15 else
16 $DB->Execute('INSERT INTO stat (hostname, version, count, timestamp) VALUES (?, ?, 1, UNIX_TIMESTAMP())', array($hostname, $version));
17
18
19 ?>

CVS Admin
ViewVC Help
Powered by ViewVC 1.1.6