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.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

45 line
1.8 KiB

  1. <!DOCTYPE html>
  2. <HTML>
  3. <HEAD>
  4. <TITLE>Character Creation</TITLE>
  5. </HEAD>
  6. <BODY>
  7. <?php
  8. session_start();
  9. include_once 'gw-connect.php';
  10. $con = new mysqli(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME);
  11. $createnew = mysqli_real_escape_string($con, $_POST['docreate']);
  12. $userid = $_SESSION['userid'];
  13. echo '<CENTER>Character creation isn\'t enabled yet!<BR />Your userid is ' . $userid . '';
  14. if ($createnew === "1"){
  15. $cname = mysqli_real_escape_string($con, $_POST['cname']);
  16. $bdate = mysqli_real_escape_string($con, $_POST['bdate']);
  17. $profid = mysqli_real_escape_string($con, $_POST['professionid']);
  18. $sqlcreate = "INSERT INTO `playername` (charname, birthdate, userid, professionid) VALUES ('$cname', '$bdate', $userid, $profid)";
  19. echo 'Character creation database insertion code here';
  20. } else {
  21. echo 'Form creation code goes here';
  22. echo '<CENTER><FORM METHOD="POST" ACTION="gw-create.php"><INPUT TYPE="HIDDEN" NAME="docreate" VALUE="1">';
  23. echo 'Character name: <INPUT TYPE="TEXT" NAME="cname" MAXLENGTH="19" SIZE="20"><BR />';
  24. echo 'Birthdate: <INPUT NAME="bdate" TYPE="DATE" PLACEHOLDER="2005-04-28"><BR />';
  25. echo '';
  26. $sqlprofession = "SELECT * FROM (SELECT * FROM listruneprofessions ORDER BY runeprofid DESC LIMIT 10) sub ORDER BY runeprofid ASC";
  27. if (!$result = $con->query($sqlprofession)){
  28. die ('There was an error running the query [' . $con->error . ']');
  29. }
  30. echo 'Profession: <SELECT NAME="profid">';
  31. echo '<OPTION SELECTED DISABLED>Choose Profession</OPTION>';
  32. while ($row = $result->fetch_array()){
  33. $professionid = $row['runeprofid'];
  34. $profession = $row['runeprofession'];
  35. echo '<OPTION VALUE="' . $professionid . '">' . $profession . '</OPTION>';
  36. }
  37. echo '</SELECT><BR /><BR /> ';
  38. echo '<INPUT TYPE="SUBMIT" VALUE="Create character ..."></FORM>';
  39. }
  40. ?>
  41. <BR /><BR />
  42. Return to <A HREF="gw-index.php">home</A>.
  43. </CENTER>
  44. </BODY>
  45. </HTML>