Guest User

Untitled

a guest
May 13th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. <?php
  2. include_once('Settings.php');
  3. /*
  4. * MySQL Information
  5. */
  6. if(!$_POST){
  7. echo 'You missed something!';
  8. } else {
  9. $connection = mysql_connect($server, $muser, $mpass) or die('Unable to connect to MySQL Database.');
  10. mysql_select_db($dbase);
  11. $query = mysql_query("SELECT * FROM accounts WHERE username ='".$_POST["username"]."' AND password ='".$_POST["password"]."'");
  12. $rows = mysql_num_rows($query);
  13.  
  14. if($rows != 0) {
  15. /* Fetching account information */
  16. while ($row = mysql_fetch_assoc($query)) {
  17. $playerName = $row['username'];
  18. $playerPass = $row['password'];
  19. }
  20. /* Saves username to a cookie placed in the browser */
  21. setcookie($uncookie, $playerName, time()+3600);
  22. /* Saves password to a cookie placed in the browser */
  23. setcookie($pwcookie, $playerPass, time()+3600);
  24. include('thanks.php');
  25. } else {
  26. include('./login/error.php');
  27. }
  28. }
  29. ?>
Add Comment
Please, Sign In to add comment