Guild Wars stat tracking The idea behind this is to track multiple characters individual stats as well as account stats.
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 

35 строки
1.3 KiB

  1. <?php
  2. $pagetitle = "Add a Guild Wars account to track";
  3. include_once ('header.php');
  4. if (!empty($_POST['accemail'])) {
  5. $addacc = $con->prepare("INSERT INTO gwaccounts (userid, accemail) VALUES (?, ?)");
  6. $addacc->bind_param("is", $_SESSION['userid'], $_POST['accemail']);
  7. $addacc->execute();
  8. $addacc->close();
  9. echo 'New account added, returning to editor.';
  10. header ("Refresh:1; url=addaccounts.php");
  11. exit();
  12. }
  13. echo '<form action="addaccounts.php" method="post"><table>';
  14. echo '<caption>Add a new Guild Wars account e-mail</caption>';
  15. echo '<tr><td><input type="text" name="accemail" size="35" autofocus required></td></tr>';
  16. echo '</table><input type="submit" value="Add account"></form><br /><br />';
  17. echo '<table border="1"><caption style="white-space: nowrap; overflow: hidden;">Current Guild Wars accounts</caption>';
  18. echo '<tr><th>Account name</th></tr>';
  19. // grab account name from database and loop it in here as a read only bit
  20. $acclist = $con->prepare("SELECT accemail FROM gwaccounts WHERE userid = ?");
  21. $acclist->bind_param("i", $_SESSION['userid']);
  22. $acclist->execute();
  23. $result = $acclist->get_result();
  24. while ($row = $result->fetch_assoc()) {
  25. echo '<tr><td>' . $row['accemail'] . '</td></tr>';
  26. }
  27. $acclist->close();
  28. echo '</table>';
  29. echo '<br />Return to your <a href="index.php" class="navlink">user</a> page';
  30. include_once ('footer.php');
  31. ?>