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.
 
 
 

53 lignes
2.2 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. list ($y, $m, $d) = explode('-', $bdate);
  19. if (!checkdate($y, $m, $d)) {
  20. echo 'Date is invalid ' . $bdate . '<BR />';
  21. echo 'Date format is YYYY-MM-DD / 2005-04-28<BR />';
  22. echo 'Please click <A HREF="gw-create.php">HERE</A> to try again';
  23. echo '<BR /><BR />Return to <A HREF="gw-index.php">home</A>.</CENTER></BODY></HTML>';
  24. exit();
  25. }
  26. $sqlcreate = "INSERT INTO `playername` (charname, birthdate, userid, professionid) VALUES ('$cname', '$bdate', $userid, $profid)";
  27. echo 'SQL Code w/ variables is: ' . $sqlcreate . '';
  28. echo 'Character creation database insertion code here';
  29. } else {
  30. echo 'Form creation code goes here';
  31. echo '<CENTER><FORM METHOD="POST" ACTION="gw-create.php"><INPUT TYPE="HIDDEN" NAME="docreate" VALUE="1">';
  32. echo 'Character name: <INPUT TYPE="TEXT" NAME="cname" MAXLENGTH="19" SIZE="20"><BR />';
  33. echo 'Birthdate: <INPUT NAME="bdate" TYPE="DATE" PLACEHOLDER="2005-04-28"><BR />';
  34. $sqlprofession = "SELECT * FROM (SELECT * FROM listruneprofessions ORDER BY runeprofid DESC LIMIT 10) sub ORDER BY runeprofid ASC";
  35. if (!$result = $con->query($sqlprofession)){
  36. die ('There was an error running the query [' . $con->error . ']');
  37. }
  38. echo 'Profession: <SELECT NAME="professionid">';
  39. echo '<OPTION SELECTED DISABLED>Choose Profession</OPTION>';
  40. while ($row = $result->fetch_array()){
  41. $professionid = $row['runeprofid'];
  42. $profession = $row['runeprofession'];
  43. echo '<OPTION VALUE="' . $professionid . '">' . $profession . '</OPTION>';
  44. }
  45. echo '</SELECT><BR /><BR /> ';
  46. echo '<INPUT TYPE="SUBMIT" VALUE="Create character ..."></FORM>';
  47. }
  48. ?>
  49. <BR /><BR />
  50. Return to <A HREF="gw-index.php">home</A>.
  51. </CENTER>
  52. </BODY>
  53. </HTML>