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.
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

28 rader
1.2 KiB

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