Skip to content

Instantly share code, notes, and snippets.

@rk4bir
Created April 1, 2019 15:14
Show Gist options
  • Save rk4bir/8133b511078e8cbfc18755175fd58ff5 to your computer and use it in GitHub Desktop.
Save rk4bir/8133b511078e8cbfc18755175fd58ff5 to your computer and use it in GitHub Desktop.
IP tracing with PHP
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<?php
error_reporting(0);
date_default_timezone_set("Asia/Dhaka");
$ip = $_SERVER['REMOTE_ADDR'];
$br = $_SERVER['HTTP_USER_AGENT'];
$info = "IP => $ip ----- Browser => $br";
$fileName = "ip_" . date("d.m.Y") . '_' . date('H.i.s') . '.txt';
$file = fopen($fileName, 'wb');
fwrite($file, $info);
fclose($file);
header("Location: http://www.aljazeera.com/");
exit();
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment