Advertisement
Guest User

Untitled

a guest
Oct 5th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <?php
  2. $username = "root";
  3. $password = "";
  4. $database = "phpbb";
  5.  
  6. mysql_connect('localhost', $username, $password) or die("Unable to connect to MySQL");
  7. @mysql_select_db($database) or die("Unable to select " . strtoupper($database));
  8.  
  9. $name = mysql_query("SELECT * FROM accounts WHERE name = $post_username") or die("MySQL Error.");
  10. while($row = mysql_fetch_array($name))
  11. {
  12. $qname = $row['name'];
  13. $qtokens = $row['tokens'];
  14. }
  15. ?>
  16.  
  17. <html>
  18. <head>
  19. <meta charset="UTF-8">
  20. <title>PHP Token Test</title>
  21. </head>
  22. <body>
  23. <h1>Welcome, <b><?php echo $qname ?></b></h1>
  24. <p>You have <b><?php echo $qtokens ?></b> tokens</p>
  25.  
  26. <form method="POST">
  27. <input type="text" name="username" placeholder="Username" />
  28. <input type="submit" />
  29. <?php $post_username = $_POST['username'] ?>
  30. </form>
  31. </body>
  32. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement