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

67 行
2.7 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">';
  22. $prefacc = $con->prepare("SELECT accid, accemail FROM gwaccounts WHERE userid = ?");
  23. $prefacc->bind_param("i", $_SESSION['userid']);
  24. $prefacc->execute();
  25. $resacc = $prefacc->get_result();
  26. while ($row = $resacc->fetch_assoc()) {
  27. echo '<option value=' . $row['accid'] . '">' . $row['accemail'] . '</option>';
  28. }
  29. echo '</td><td><input type="submit" value="Set account"></td></tr></select></table></form>';
  30. // select which character from your GW account you want to default to
  31. # needed code: select charrid from table gwchars selected by accid
  32. // update e-mail address form
  33. echo '<form action="preferences.php" method="post"><table border="1">';
  34. echo '<caption>Update e-mail address</caption>';
  35. echo '<tr><td><input type="text" name="useremail" value="' . $_SESSION['usermail'] . '"></td><td><input type="submit" value="Update e-mail"></td></tr>';
  36. echo '</table></form><br /><br />';
  37. // update password form
  38. echo <<<UPDPASS
  39. <form action="preferences.php" method="post"><table border="1">
  40. <tr><th>Old Password</th><tr>
  41. <tr><td><input type="password" name="oldpass" required></td></tr>
  42. <tr><th>New password</th></tr>
  43. <tr><td><input type="password" required="required" name="userpass1" id="up1"></td></tr>
  44. <tr><th>Verify password</th></tr>
  45. <tr><td><input type="password" required="required" name="userpass2" id="up2"></td></tr>
  46. </table><script type="text/javascript">
  47. function Validate() {
  48. var userpass1 = document.getElementById("up1").value;
  49. var userpass2 = document.getElementById("up2").value;
  50. if (userpass1 != userpass2) {
  51. alert("Passwords do not match.");
  52. return false;
  53. }
  54. return true;
  55. }
  56. </script>
  57. <input type="submit" name="submission" value="Update password" onclick="return Validate()" id="btnSubmit"></form>
  58. UPDPASS;
  59. include_once ('footer.php');
  60. ?>