Guest User

Untitled

a guest
Oct 22nd, 2019
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.31 KB | None | 0 0
  1. <html>
  2.     <head>
  3.         <title>What is my IP?</title>
  4.         <meta charset="utf-8">
  5.         <link rel="stylesheet" href="style.css">
  6.     </head>
  7.     <body>
  8.         <header>
  9.             <h2>What is my IP?</h2>
  10.         </header>
  11.  
  12.         <section>
  13.             <nav>
  14.                 <img src="https://styleguide.torproject.org/static/images/black.svg">
  15.             </nav>
  16.  
  17.             <article>
  18.                 <?php
  19.                     // https://www.tutorialspoint.com/sqlite/sqlite_php.htm
  20.                     ini_set('display_errors', 0);
  21.                     ini_set('display_errors', false);
  22.  
  23.                     class MyDB extends SQLite3 {function __construct() {$this->open('test.db');}}
  24.                     $db = new MyDB();
  25.  
  26.                     echo "<h2>".$_SERVER["REMOTE_ADDR"]."</h2>";
  27.                     echo "<h1>".$_SERVER["HTTP_USER_AGENT"]."</h1>";
  28.  
  29.                     $sql = "INSERT INTO browsers (useragent) VALUES ('".$_SERVER["HTTP_USER_AGENT"]."');";
  30.                     $ret = $db->exec($sql);
  31.                     $db->close();
  32.                 ?>
  33.  
  34.             </article>
  35.         </section>
  36.  
  37.         <footer>
  38.             <p>Stay safe and hide your IP address with <a href="https://www.torproject.org/" target="_blank">Tor Browser</a>.</p>
  39.         </footer>
  40.     </body>
  41. </html>
Advertisement
Add Comment
Please, Sign In to add comment