daily pastebin goal
50%
SHARE
TWEET

Untitled

a guest Dec 23rd, 2017 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $host = "db_host";
  3. $username = 'db_user';
  4. $password = 'db_pass';
  5. $database = "db_name";
  6. $ip = $_SERVER['REMOTE_ADDR'];
  7. $browser = $_SERVER['HTTP_USER_AGENT'];
  8. $date = date("F j, Y, g:i a");
  9. $fhost = gethostbyaddr($ip);
  10. $host = preg_replace("/^[^.]+./", "", $fullhost);
  11. $url = “http” . ((!empty($_SERVER['HTTPS'])) ? “s” : “”) .
  12. $connect = mysql_connect($host,$username,$pwd) or die("Connection to database failed.");
  13. mysql_select_db($database, $connect);
  14. mysql_query("INSERT INTO table_name (column1, column2, column3, column4, column5) VALUES ('$ip', '$browser', '$date', '$host', '$url')");
  15. mysql_close();
  16. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top