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.
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

37 lines
1.2 KiB

  1. <!DOCTYPE html>
  2. <HTML>
  3. <HEAD>
  4. <?php
  5. session_start();
  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']);
  9. $password = mysqli_real_escape_string($con, $_POST['password']);
  10. $password = md5($password);
  11. if ($con->connect_errno > 0){
  12. die ('Unable to connect to database [' . $db->connect_errno . ']');
  13. }
  14. $sqllogin = "SELECT * FROM users WHERE users.username = '$username' and password = '$password'";
  15. if ($result = $con->query($sqllogin)){
  16. $row_cnt = mysqli_num_rows($result);
  17. if ($row_cnt > 0){
  18. while ($row = $result->fetch_array()){
  19. $uname = $row['username'];
  20. $uid = $row['userid'];
  21. $access = $row['access'];
  22. $_SESSION['username'] = $uname;
  23. $_SESSION['userid'] = $uid;
  24. $_SESSION['access'] = $access;
  25. }
  26. header("refresh:3;url=gw-index.php");
  27. echo '<TITLE>Logged in</TITLE></HEAD><BODY><CENTER>';
  28. echo 'You have successfully logged in ...<BR />Returning to index in a few seconds</CENTER>';
  29. } else {
  30. echo '<TITLE>Invalid login</TITLE></HEAD><BODY><CENTER>';
  31. echo 'That was not a valid username or password!<BR /><BR />';
  32. echo 'Please try again <A HREF="gw-index.php">here</A></CENTER>';
  33. }
  34. }
  35. ?>
  36. </BODY>
  37. </HTML>