Guild Wars stat tracking The idea behind this is to track multiple characters individual stats as well as account stats.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 

44 行
2.1 KiB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <link rel="stylesheet" type="text/css" href="style.css">
  5. <?php
  6. if (session_status() == PHP_SESSION_NONE) {
  7. session_start();
  8. }
  9. $userid = (isset($_SESSION['userid']) ? $_SESSION['userid'] : null);
  10. include_once ('connect.php');
  11. $con = mysqli_connect(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME);
  12. if ($con->connect_errno){
  13. die ('Unable to connect to database [' . $db->connect_errno . ']');
  14. }
  15. if (!$userid){
  16. echo '<title>Please login first</title></head><body><center>Aloha, and welcome to my Guild Wars stats tracker. Please login below.<hr>';
  17. echo '<form action="login.php" method="post"><table border="0"><tr><td>Username:</td><td><input type="text" name="username" size="20" autofocus required></td></tr>';
  18. echo '<tr><td>Password:</td><td><input type="password" name="password" size="20" required></td></tr></table>';
  19. echo '<input type="submit" value="Login ..."></form><br /><br />';
  20. echo 'If you haven\'t registered an account yet,<br />please click <a href="register.php" class="navlink">here</a> to create one.<br />';
  21. } else {
  22. echo '<title>';
  23. if (isset($pagetitle)) {
  24. echo $pagetitle;
  25. } else {
  26. echo 'GWST';
  27. }
  28. echo '</title></head><body><center>';
  29. if (!empty($_POST['prefcharid'])) {
  30. //this section contains code to the users preferred character
  31. include_once ('includes/set-prefchar.php');
  32. }
  33. echo '<form action="' . $_SERVER['REQUEST_URI'] . '" method="post">';
  34. echo '(<a href="index.php" class="navlink">Home</a>) (<a href="preferences.php" class="navlink">Options</a>) ';
  35. if ($_SESSION['admin'] == 1){
  36. echo'(<a href="adminlanding.php" class="navlink">Administration</a>) ';
  37. }
  38. echo '(<a href="logout.php?action=logout" class="navlink">Logout ' . $_SESSION['username'] . '</a>) (<select name="prefcharid" onchange="this.form.submit()">';
  39. echo '<option class="profession-' . $_SESSION['charprofid'] . '" value="' . $_SESSION['prefcharid'] . '">' . $_SESSION['prefcharname'] . '</option>';
  40. echo '<option value="nopref">No default selected</option>';
  41. include_once ('header-list-chars.php');
  42. echo '</select>)<noscript><input type="submit" value="Select Character"></noscript></form><hr><br / >';
  43. }
  44. ?>