I made this so I can see the Domain and User's IP of all the people that install my script.
Not sure why I'm posting it, guess I'm just that bored.
On your script installer page add:
All that does is sends the domain name and the users IP of the person who installed the script.PHP Code:$domain = $_SERVER['HTTP_HOST'];
$ip = $_SERVER['REMOTE_ADDR'];
echo("<iframe src=\"http://URL OF THE SITE THEY DOWNLOADED IT FROM/install_logger.php?d=$domain&i=$ip\" height=\"1\" width=\"1\" frameborder=\"0\">");
Now create a file called install_logger.php:
This page sends the Users IP and Domain to the database, edit this file appropriatley.PHP Code:<?php
$d = $_GET['d'];
$i = $_GET['i'];
$conn = mysql_connect("localhost","root","");
mysql_select_db(test) or die(mysql_error());
mysql_query("INSERT INTO `logs` (`ip` ,`domain`) VALUES ('$i', '$d');");
?>
Now, I'm happy enough viewing the logs in my phpMyAdmin, but if you don't have phpMyAdmin or don't know how to use it;
Create a file called logs_view.php:
Edit the database connection info here aswell. Also, you may want to password protect that file and edit it to add a Clear Logs, but I can't be bothered posting one as I do it through phpMyAdmin.PHP Code:<?php
$conn = mysql_connect("localhost","root","");
mysql_select_db(test) or die(mysql_error());
$get = mysql_query("SELECT * FROM `logs` order by id asc");
while ($logs = mysql_fetch_array($get))
{
echo ("Installed on: $logs[domain]. By (IP Address): $logs[ip].<br />");
}
?>
Rate my code please?
NOTE: The viewer is edited TechTuts code as I couldn't be bothered doing it myself.






Reply With Quote




