Seven Years of Service
Posts: 204
Threads: 77
IP Recorder Code, site 01-23-2020, 11:58 PM
#1
Code:
<?php
$ipaddres = $_SERVER["REMOTE_ADDR"];
$scannee= $_SERVER["HTTP_USER_AGENT"];
$ip= fopen("ip.txt", "a");
fwrite($ip,"name Chrome : $scanner<br> İp : $ipaddres");
?>
Users who visited your site.
Records the ip address. Put it in the index.php file.
It saves at
www.site.com/ip.txt
(This post was last modified: 01-24-2020, 12:00 AM by SCARIO.)
we obey a god that does not exist.
SCARIO
•
Fourteen Years of Service
Posts: 74,287
Threads: 317
RE: IP Recorder Code, site 01-24-2020, 02:52 AM
#2
The majority of my sites are configured to save visitor's IP addresses, but those that don't, I'll look Into this script.
Thanks.
•
Ten Years of Service
Posts: 7,862
Threads: 3,965
RE: IP Recorder Code, site 01-24-2020, 03:34 PM
#3
Thanks very helpful. I normally use Statcounter as it show all type of information with a hidden JavaScript snip.
•
Seven Years of Service
Posts: 204
Threads: 77
RE: IP Recorder Code, site 01-25-2020, 09:32 AM
#4
(01-24-2020, 02:52 AM)mothered Wrote: The majority of my sites are configured to save visitor's IP addresses, but those that don't, I'll look Into this script.
Thanks.
(01-24-2020, 03:34 PM)hacxx Wrote: Thanks very helpful. I normally use Statcounter as it show all type of information with a hidden JavaScript snip.
This code. It sees your work.
Code:
<?php
$protocol = $_SERVER['SERVER_PROTOCOL'];
$ip = $_SERVER['REMOTE_ADDR'];
$port = $_SERVER['REMOTE_PORT'];
$agent = $_SERVER['HTTP_USER_AGENT'];
$ref = $_SERVER['HTTP_REFERER'];
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$fh = fopen('ip.txt', 'a');
fwrite($fh, 'IP Address: '."".$ip ."\n");
fwrite($fh, 'Hostname: '."".$hostname ."\n");
fwrite($fh, 'Port Number: '."".$port ."\n");
fwrite($fh, 'User Agent: '."".$agent ."\n");
fwrite($fh, 'HTTP Referer: '."".$ref ."\n\n");
fclose($fh);
?>
we obey a god that does not exist.
SCARIO
Ten Years of Service
Posts: 7,862
Threads: 3,965
RE: IP Recorder Code, site 01-25-2020, 03:24 PM
#6
I know. That's the main reason why i just code in client side.
•
Seven Years of Service
Posts: 7
Threads: 0
RE: IP Recorder Code, site 02-04-2020, 03:12 PM
#7
Whahahhaha. Wtf was that video man.
•