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.
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

27 righe
1.1 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 (empty($whattoon)){
  15. echo 'Options for what to do after character selection goes here <BR />';
  16. echo 'Character id selected is ' . $whattoon . '<BR />';
  17. } else {
  18. echo '<FORM METHOD="POST" NAME="cselect" ACTION="gw-toon.php">';
  19. echo '<SELECT NAME="cname">';
  20. while ($row = $result->fetch_array()){
  21. $charid = $row['playerid'];
  22. $charname = $row['charname'];
  23. echo '<OPTION VALUE="' . $charid . '">' . $charname . '</OPTION>';
  24. }
  25. echo '</SELECT><INPUT TYPE="SUBMIT" VALUE="Choose Toon"></FORM>';
  26. }
  27. ?>