Just a web script to help track when, where, and what you got from the free treasures scattered about Nightfall in the game Guild Wars.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

26 lignes
1.0 KiB

  1. <?php
  2. include_once 'gw-connect.php';
  3. $con = new mysqli(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME);
  4. $userid = 1; //need to actually pull this info from cookie/session (preferable)
  5. $whattoon = mysqli_real_escape_string($con, $_POST['cname']);
  6. if ($con->connect_errno > 0){
  7. die ('Unable to connect to database [' . $db->connect_errno . ']');
  8. }
  9. $sql = "SELECT playerid, charname FROM `playername` WHERE `userid` = '1' ORDER BY `charname` ASC"; //need to make userid a variable
  10. if (!$result = $con->query($sql)){
  11. die ('There was an error running the query [' . $con->error . ']');
  12. }
  13. # experimental stuff
  14. if (isset($whattoon)){
  15. echo 'Options for what to do after character selection goes here <BR />';
  16. } else {
  17. echo '<FORM METHOD="POST" NAME="cselect" ACTION="gw-toon.php">';
  18. echo '<SELECT NAME="cname">';
  19. while ($row = $result->fetch_array()){
  20. $charid = $row['playerid'];
  21. $charname = $row['charname'];
  22. echo '<OPTION VALUE="' . $charid . '">' . $charname . '</OPTION>';
  23. }
  24. echo '</SELECT><INPUT TYPE="SUBMIT" VALUE="Choose Toon"></FORM>';
  25. }
  26. ?>