Just a web script to help track when, where, and what you got from the free treasures scattered about Nightfall in the game Guild Wars.
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

31 wiersze
1.3 KiB

  1. <?php
  2. session_start();
  3. if (isset($_SESSION['userid']) && ($_SESSION['access'])){
  4. echo 'Proceed to character selection <A HREF="gw-toon.php">here</A><BR>'; //really should automate this
  5. } else {
  6. include_once 'gw-connect.php';
  7. $con = new mysqli(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME);
  8. $username = mysqli_real_escape_string($con, $_POST['username']); //enable this after username form is built
  9. //$username = 'mauirixxx'; //delete this line after the above is finished
  10. $password = mysqli_real_escape_string($con, $_POST['password']); //enable this after password form is built
  11. //$password = 'drx9175l';
  12. $password = md5($password);
  13. if ($con->connect_errno > 0){
  14. die ('Unable to connect to database [' . $db->connect_errno . ']');
  15. }
  16. $sqllogin = "SELECT * FROM users WHERE users.username = '$username' and password = '$password'";
  17. if (!$result = $con->query($sqllogin)){
  18. echo 'Invalid username or password';
  19. die ('There was an error running the query [' . $con->error . ']');
  20. }
  21. while ($row = $result->fetch_array()){
  22. $uname = $row['username'];
  23. $uid = $row['userid'];
  24. $access = $row['access'];
  25. $_SESSION['username'] = $uname;
  26. $_SESSION['userid'] = $uid;
  27. $_SESSION['access'] = $access;
  28. echo 'Your username is ' . $uname . '. Your userid is ' . $uid . '. Your access level is ' . $access . '.<BR />';
  29. }
  30. }
  31. ?>