Guild Wars stat tracking The idea behind this is to track multiple characters individual stats as well as account stats.
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 

66 linhas
2.8 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['setacc'])) {
  13. //this section contains code to set the users preferred game account
  14. include_once ('includes/set-prefacc.php');
  15. }
  16. echo '<h3>Change e-mail or password</h3>';
  17. // select which GW account you want to default to
  18. echo '<form action="preferences.php" method="post"><table border="1"><caption style="white-space: nowrap; overflow: hidden;">Current preferred account: <b>' .$_SESSION['prefaccname'] . '</b></caption>';
  19. echo '<tr><td><select name="prefaccid">';
  20. echo '<option value="nopref">Prefer no default</option>';
  21. $prefacc = $con->prepare("SELECT accid, accemail FROM gwaccounts WHERE userid = ?");
  22. $prefacc->bind_param("i", $_SESSION['userid']);
  23. $prefacc->execute();
  24. $resacc = $prefacc->get_result();
  25. while ($row = $resacc->fetch_assoc()) {
  26. echo '<option value="' . $row['accid'] . '">' . $row['accemail'] . '</option>';
  27. }
  28. echo '</td><td><input type="submit" value="Set account"></td></tr></select></table><input type="hidden" name="setacc" value="update"></form><br />';
  29. // select which character from your GW account you want to default to
  30. # needed code: select charrid from table gwchars selected by accid
  31. // update e-mail address form
  32. echo '<form action="preferences.php" method="post"><table border="1">';
  33. echo '<caption>Update e-mail address</caption>';
  34. echo '<tr><td><input type="text" name="useremail" value="' . $_SESSION['usermail'] . '"></td><td><input type="submit" value="Update e-mail"></td></tr>';
  35. echo '</table></form><br /><br />';
  36. // update password form
  37. echo <<<UPDPASS
  38. <form action="preferences.php" method="post"><table border="1">
  39. <tr><th>Old Password</th><tr>
  40. <tr><td><input type="password" name="oldpass" required></td></tr>
  41. <tr><th>New password</th></tr>
  42. <tr><td><input type="password" required="required" name="userpass1" id="up1"></td></tr>
  43. <tr><th>Verify password</th></tr>
  44. <tr><td><input type="password" required="required" name="userpass2" id="up2"></td></tr>
  45. </table><script type="text/javascript">
  46. function Validate() {
  47. var userpass1 = document.getElementById("up1").value;
  48. var userpass2 = document.getElementById("up2").value;
  49. if (userpass1 != userpass2) {
  50. alert("Passwords do not match.");
  51. return false;
  52. }
  53. return true;
  54. }
  55. </script>
  56. <input type="submit" name="submission" value="Update password" onclick="return Validate()" id="btnSubmit"></form>
  57. UPDPASS;
  58. include_once ('footer.php');
  59. ?>