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.
Não pode escolher mais do que 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.
 
 
 

26 linhas
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. ?>