Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
$fp = fopen("log.txt", "a");
flock($fp, LOCK_EX);
$timezone = 'Asia/Tehran';
date_default_timezone_set($timezone);
$date = date('m/d/Y h:i:s a', time());
fputs($fp, "TIME: $date\n");
$timezone = date_default_timezone_get();
fputs($fp, "TIMEZONE: $timezone\n");
$QUERY_STRING = $_SERVER['QUERY_STRING'];
fputs($fp, "QUERY_STRING: $QUERY_STRING\n");
$HTTP_X_FORWARDED_FOR = $_SERVER['HTTP_X_FORWARDED_FOR'];
fputs($fp, "HTTP_X_FORWARDED_FOR: $HTTP_X_FORWARDED_FOR\n");
$REMOTE_ADDR = $_SERVER['REMOTE_ADDR'];
fputs($fp, "REMOTE_ADDR: $REMOTE_ADDR\n");
$HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
fputs($fp, "HTTP_USER_AGENT: $HTTP_USER_AGENT\n");
fputs($fp, "================================\n");
flock($fp, LOCK_UN);
fclose($fp);
$name = 'nothing.png';
$fp = fopen($name, 'rb');
header("Content-Type: image/png");
header("Content-Length: " . filesize($name));
fpassthru($fp);
exit;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment