Unsupported scripts and control panel web app for a hosting company
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

stats.php 632B

12345678910111213141516171819202122
  1. #!/usr/local/php-stable/bin/php -q
  2. <?PHP
  3. mysql_connect('', '', '');
  4. mysql_select_db('');
  5. $sql = 'SELECT site_id, site_name FROM sites';
  6. $res = mysql_query($sql);
  7. while ($row = mysql_fetch_array($res)) {
  8. $id = str_pad($row[0],3,'0',STR_PAD_LEFT);
  9. if (!is_dir('/home/utd/stats/'.$id)) {
  10. mkdir('/home/utd/stats/'.$id);
  11. }
  12. if (!file_exists('/usr/local/apache/logs/'.$id.'-access_log')) {
  13. continue;
  14. }
  15. $row[1] = addslashes($row[1]);
  16. system('/usr/local/bin/webalizer -o /home/utd/stats/'.$id.'/ -n \''.$row[1].'\' -t \''.$row[1].'\' -N 5 -D /home/utd/dnscache /usr/local/apache/logs/'.$id.'-access_log');
  17. }
  18. ?>