Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //get IP
- if (getenv("HTTP_CLIENT_IP")) $ip = getenv("HTTP_CLIENT_IP");
- else if(getenv("HTTP_X_FORWARDED_FOR")) $ip = getenv("HTTP_X_FORWARDED_FOR");
- else if(getenv("REMOTE_ADDR")) $ip = getenv("REMOTE_ADDR");
- else $ip = "UNKNOWN";
- // log download and redirect to file
- if (isset($_GET['dl']))
- {
- $filename = $_GET['dl'];
- $ff = fopen('down_log.txt', 'a');
- $today = date("Y-m-d H:i");
- fwrite($ff,"$today - $ip - $filename<br>");
- fclose($ff);
- header("Location: https://mydomain.tld/$filename");
- die;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement