ÿØÿàJFIFÿÛ„ ( %"1"%)+...383,7(-.- 404 Not Found
Sh3ll
OdayForums


Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20
System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 7.4.20
Disable Function : NONE
Directory :  /var/www/html/vidoe.top/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/vidoe.top/lib/littleCounter.php
<?php

 // MySQL Dump:

 /*

 

  CREATE TABLE `counter` (

  `ID` int(8) NOT NULL auto_increment,

  `timestamp` varchar(14) default NULL,

  `ip` varchar(15) NOT NULL default '',

  KEY `ID` (`ID`)

  ) TYPE=MyISAM ;

  ////////////////////

 */

 class littleCounter {

 

	var $onlinetime;

   

    var $dbtable='counter';

	

	function insert_new_hit( ) {

	global $DB;

		$ip = getenv("REMOTE_ADDR");

		$timestamp = time();

		$insert_query = "INSERT INTO $this->dbtable (ip, timestamp) VALUES ('$ip', '$timestamp')";

		$query = $DB->query($insert_query);

		if ($query) return TRUE;

		else return FALSE;

	}

	function show_counter( $mode ) {

	global $DB;

		switch ($mode) {

		    // Total Hits:

			case "hits":   $select_query = "SELECT ip 

											FROM $this->dbtable"; break;

											

			// Total Visitors:

			case "total":  $select_query = "SELECT DISTINCT ip 

											FROM $this->dbtable"; break;

											

			// Visitors online:

			case "online": $select_query = "SELECT ip, timestamp 

											FROM $this->dbtable 

											WHERE timestamp>=UNIX_TIMESTAMP()-$this->onlinetime 

											AND timestamp<=UNIX_TIMESTAMP() GROUP BY ip"; break;

											

			// Hits of one IP during the last 24 hours:

			case "hits_of_user": 

							$ip = getenv("REMOTE_ADDR");

							$select_query = "SELECT ip, timestamp 

											 FROM $this->dbtable 

											 WHERE timestamp>=UNIX_TIMESTAMP()-84600 

											 AND timestamp<=UNIX_TIMESTAMP() 

											 AND ip='$ip'"; break;

		}

		$query = $DB->query($select_query) ;

		if ($query) $result = $DB->get_num_rows($query);

		else $result = 0;

		return $result;

	}

	

 }

?>

ZeroDay Forums Mini