Log page to databse


/ Published in: Other
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function logPage($page) {
  2.  
  3. dbConnect();
  4.  
  5. if ($_SERVER['HTTP_REFERER'] == "") {
  6.  
  7. $_SERVER['HTTP_REFERER'] = "N/A";
  8.  
  9. }
  10.  
  11. mysql_query("INSERT INTO log_leiding (id, http_host, phpsessid, request_uri, page, http_referer, http_user_agent, remote_addr, date, time, source) VALUES ('', '{$_SERVER['HTTP_HOST']}', '{$_REQUEST['PHPSESSID']}', '{$_SERVER['REQUEST_URI']}', '{$page}', '{$_SERVER['HTTP_REFERER']}', '{$_SERVER['HTTP_USER_AGENT']}', '{$_SERVER['REMOTE_ADDR']}', NOW(), NOW(), '{$_SESSION[source]}')");
  12. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.