-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathout.php
More file actions
28 lines (28 loc) · 863 Bytes
/
out.php
File metadata and controls
28 lines (28 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
/**
* Tracks outbound URLs
*
* @author Timothy Su
* @link http://www.timofeo.com/
* @license http://opensource.org/licenses/MIT
*/
date_default_timezone_set('UTC');
if (isset($_GET['url']) && isset($_GET['user'])) {
$dest = $_GET['url'];
$user = $_GET['user'];
$data = "[OUT] - ";
$data = $data . date('Y/m/d H:i:s');
$data = $data . " - " . $user . " - " . $dest . "\n";
if (file_exists('./log/' . $user . '.log')) {
$data = file_get_contents('./log/' . $user . '.log') . $data;
}
file_put_contents('./log/' . $user . '.log', $data);
}
else {
$dest = '/';
}
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header('Location: ' . $dest);
exit;
?>