Guild Wars stat tracking The idea behind this is to track multiple characters individual stats as well as account stats.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

68 rivejä
2.9 KiB

  1. <?php
  2. $pagetitle = "Account options";
  3. include_once ('header.php');
  4. if (!empty($_POST['useremail'])) {
  5. //this section contains code to update the users e-mail address
  6. include_once ('includes/update-email.php');
  7. }
  8. if (!empty($_POST['oldpass'])) {
  9. // this section contains code to update the users password after verifying the old password first
  10. include_once ('includes/update-password.php');
  11. }
  12. if (!empty($_POST['prefacc'])) {
  13. //this section contains code to set the users preferred game account
  14. #include_once ('includes/set-prefacc.php');
  15. echo 'this line will go away once the include file is completed!<br />';
  16. }
  17. echo '<h3>Change e-mail or password</h3>';
  18. // select which GW account you want to default to
  19. # needed code: select accid from table gwaccounts, store it in prefacc in table userinfo
  20. echo '<form action="preferences.php" method="post"><table><caption>Preferred GW account</caption>';
  21. echo '<tr><td><select name="prefacc"><option value="' . $_SESSION['prefaccid'] . '">' . $_SESSION['prefaccname'] . ' (current selection)</option>';
  22. echo '<option value="0">No default selected</option>';
  23. $prefacc = $con->prepare("SELECT accid, accemail FROM gwaccounts WHERE userid = ?");
  24. $prefacc->bind_param("i", $_SESSION['userid']);
  25. $prefacc->execute();
  26. $resacc = $prefacc->get_result();
  27. while ($row = $resacc->fetch_assoc()) {
  28. echo '<option value=' . $row['accid'] . '">' . $row['accemail'] . '</option>';
  29. }
  30. echo '</td><td><input type="submit" value="Set account"></td></tr></select></table></form><br />';
  31. // select which character from your GW account you want to default to
  32. # needed code: select charrid from table gwchars selected by accid
  33. // update e-mail address form
  34. echo '<form action="preferences.php" method="post"><table border="1">';
  35. echo '<caption>Update e-mail address</caption>';
  36. echo '<tr><td><input type="text" name="useremail" value="' . $_SESSION['usermail'] . '"></td><td><input type="submit" value="Update e-mail"></td></tr>';
  37. echo '</table></form><br /><br />';
  38. // update password form
  39. echo <<<UPDPASS
  40. <form action="preferences.php" method="post"><table border="1">
  41. <tr><th>Old Password</th><tr>
  42. <tr><td><input type="password" name="oldpass" required></td></tr>
  43. <tr><th>New password</th></tr>
  44. <tr><td><input type="password" required="required" name="userpass1" id="up1"></td></tr>
  45. <tr><th>Verify password</th></tr>
  46. <tr><td><input type="password" required="required" name="userpass2" id="up2"></td></tr>
  47. </table><script type="text/javascript">
  48. function Validate() {
  49. var userpass1 = document.getElementById("up1").value;
  50. var userpass2 = document.getElementById("up2").value;
  51. if (userpass1 != userpass2) {
  52. alert("Passwords do not match.");
  53. return false;
  54. }
  55. return true;
  56. }
  57. </script>
  58. <input type="submit" name="submission" value="Update password" onclick="return Validate()" id="btnSubmit"></form>
  59. UPDPASS;
  60. include_once ('footer.php');
  61. ?>