Advertisement
Guest User

Untitled

a guest
Nov 25th, 2015
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. $nextWeek = time() + (7 * 24 * 60);
  2. $date=date('Y-m-d');
  3. $ip= $_SERVER["REMOTE_ADDR"];
  4. //Server Information
  5. $servername = "localhost";
  6. $username = "root";
  7. $password = "";
  8. $dbname = "logserver";
  9.  
  10. // Create connection
  11. $conn = new mysqli($servername, $username, $password, $dbname);
  12. // Check connection
  13. if ($conn->connect_error) {
  14. die("Connection failed: " . $conn->connect_error);
  15. }
  16. //GETTING FROM FORM/SESSION
  17. $user=['user']; //session ID $_Session ['user']
  18. $lat="somevalue";
  19. $lon="somevalue2";
  20. $ports="R#69"; //Form Submission
  21. $cmds="delete vlan.dat"; //Form Submission
  22. //END OF GETTING FROM FORM
  23.  
  24. $hash =hash('sha512',$date.$user.$lat.$lon.$ports.$cmds.$ip,false);
  25. $sql = ("insert into logs(logId,YYMMDD,User,Lat,Lon,Ports,Cmds,Ip,Hash)"
  26. ."VALUES"."(".
  27. "'"."'".",".
  28. "'".$date."'".",".
  29. "'".$user."'".",".
  30. "'".$lat."'".",".
  31. "'".$lon."'".",".
  32. "'".$ports."'".",".
  33. "'".$cmds."'".",".
  34. "'".$ip."'".",".
  35. "'".$hash."'".
  36. ");");
  37.  
  38. echo $sql;
  39. $result = $conn->query($sql);
  40.  
  41.  
  42. $conn->close();
  43. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement