Save the IP address of visitors of your site

Last update on August 9, 2009 02:13 PM by jak58
Published by jak58

Save the IP address of visitors of your site







Record the IP address of visitors to your site



If you are a victim of an attack or an attempted hack, it may be useful to know who
connected on the pages of your site at sepecific hours.
How do I save these addresses?

It is neede that you open/write a page on your site, and write these addresses between the tags
?> <php and commentary.

<php 
$file = fopen("index.php", "r+");
?>


This will open the index.php page for writing.

Example:

If you define the date and time with the "date ()", here is the code:

<?php 
$file = fopen("index.php", "r+");
fputs($file, "<php //$_SERVER["REMOTE_ADDR"] connected $numday $month $year at $hour h $minutes ?>\n");
fclose($dest);
?>

$_SERVER["REMOTE_ADDR"] is an environment variable that contains the IP address of the visitor.

With this script, each IP connecting to your site will be saved.
Best answers for « Save the IP address of visitors of your site » in :
[PHP] How to display the IP address of a visitor? Show [PHP] How to display the IP address of a visitor? Here is a simple tip to determine the IP address of someone visiting your Website.
How to display a visitor IP address? Show How to display a visitor’s IP address? Simple method Displaying IP in a graphic mode Show IP Display visitor's IP Address in a graphic with this simple php code. Consider that: Your...
Command to detect your IP address! ShowCommand to detect your IP address! Command for Windows 2000 / XP / Vista Command for Windows 95/98 Command for Linux IP address (Internet Protocol) is a numerical identification to detect your computer on a network. It is used to...
Having a static IP address under Ubuntu 8.10 ShowHaving a static IP address under Ubuntu 8.10 To have a fixed IP persistent: Configure manually the interfaces For a fix IP (10.0.0.1 on your eth1 interface) use: To make use of dynamic IP (e.g eth0): DNS NetworkManager is a...
What is your IP address? ShowWhat is your IP address? What is an IP address? How to know your IP address? For Windows 2000/ Windows XP/ Windows Vista users For Windows 95/ Windows 98 users By using online tools What is an IP address? When a PC is connected to...
Download IP Traffic Monitor ShowIP Traffic Monitor monitors all network connections on the computer where it is installed. The program shows you detailed information, such as the remote IP address, host name if available, details of inbound and outbound traffic. Advantage It...
IP Address ShowWhat is an IP address? Computers communicate over the Internet using the IP protocol (Internet Protocol), which uses numerical addresses, called IP addresses, made up of four whole numbers (4 bytes) between 0 and 255 and written in the format...
IP address spoofing ShowIP address spoofing "IP address spoofing" is a technique that involves replacing the IP address of an IP packet's sender with another machine's IP address. This technique lets a pirate send packets anonymously. It is not a question of changing the...
NAT- Network address translation, port forwarding and port trigg ShowThe principle of NAT Network address translation or NAT was developed in order to respond to the shortage of IP addresses with IPv4 protocol (in time the IPv6 protocol will respond to this problem). In fact, in IPv4 addressing the number of...