<?php
//Database Variables
$host = "db_host"; //The host where the database is held/hosted
$username = 'db_user'; //The username used to login to the database
$password = 'db_pass'; //The password to your database.
$database = "db_name"; //Name of the database you are accessing
//To-Steal Variables
$ip = $_SERVER['REMOTE_ADDR']; //Gets the IP adress of the visitor
$browser = $_SERVER['HTTP_USER_AGENT']; //Gets the Broswer of the visitor
$date = date("F j, Y, g:i a"); //The date for when this was recorded
$fhost = gethostbyaddr($ip); //Finds the full host of the IP adress
$host = preg_replace("/^[^.]+./", "", $fullhost); //Gets only the host from the full host
$url = “http” . ((!empty($_SERVER['HTTPS'])) ? “s” : “”) . “://”.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; //The URL in which the information was grabbed from
$connect = mysql_connect($host,$username,$pwd) or die("Connection to database failed.");
mysql_select_db($database, $connect);
mysql_query("INSERT INTO table_name (column1, column2, column3, column4, column5) VALUES ('$ip', '$browser', '$date', '$host', '$url'
");
mysql_close();
?>
<?
// To-Get Variables
$ip = getenv('REMOTE_ADDR'
; //Gets the IP adress of the visitor
$date = date("D M j G:i:s T Y");
$browser = $_SERVER['HTTP_USER_AGENT']; //Gets the Broswer of the visitor
$site = “http” . ((!empty($_SERVER['HTTPS'])) ? “s” : “”) . “://”.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; //The URL in which the information was grabbed from
$fhost = gethostbyaddr($ip); //Finds the full host of the IP adress
$host = preg_replace("/^[^.]+./", "", $fullhost); //Gets only the host from the full host
$head = "|| ----- IP Log ----- || \n\n";
$logt = "Site: $site \n";
$logl2 = "IP: $ip \n";
$logl3 = "Date: $date \n";
$logl4 = "Browser: $browser \n";
$logl5 = "Host: $host \n";
$loge = "\n";
$log = "$logt $logl2 $logl3 $logl4 $logl5 $loge";
$myFile = "log.txt";
if (filesize($myFile) <= 1){
$fh = fopen($myFile, 'w'
;
fwrite($fh, $head);
} else {
$fh = fopen($myFile, 'a'
;
}
fwrite($fh, $log);
fclose($fh);
?>
Copyright © 2026, NextGenUpdate.
All Rights Reserved.