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.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 

40 rindas
2.5 KiB

  1. <?php
  2. include_once 'gw-connect.php';
  3. $con = new mysqli(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME);
  4. #non-section specific POST data here
  5. $gold = mysqli_real_escape_string($con, $_POST['droppedgold']); //how much gold dropped
  6. $droptype = mysqli_real_escape_string($con, $_POST['droptype']); //this dictates if the drop was a weapon/rune/material
  7. $locid = mysqli_real_escape_string($con, $_POST['location']); //this is `treasurelocation`.`treasureid` in the database
  8. $toonid = mysqli_real_escape_string($con, $_POST['chartoon']); //this is the id of the character doing the hunting
  9. $treasdate = mysqli_real_escape_string($con, $_POST['treasuredate']); //
  10. if ($droptype == 1){
  11. $rarity = mysqli_real_escape_string($con, $_POST['rare']);
  12. $req = mysqli_real_escape_string($con, $_POST['requirement']);
  13. $attrib = mysqli_real_escape_string($con, $_POST['attribute']);
  14. $weap = mysqli_real_escape_string($con, $_POST['weapon']);
  15. $itname = mysqli_real_escape_string($con, $_POST['itemname']);
  16. $sqlweapins = "INSERT INTO `history` (historydate, charnameid, locationid, goldrec, itemreq, itemtype, itemattribute, itemrarity, itemname) VALUES ('$treasdate', $toonid, $locid, $gold, $req, $weap, $attrib, $rarity, '$itname')";
  17. if (!$result = $con->query($sqlweapins)){
  18. die ('There was an error running the query [' . $con->error . ']');
  19. }
  20. } else if ($droptype == 2){
  21. $matid = mysqli_real_escape_string($con, $_POST['rarematerials']);
  22. $sqlmatin = "INSERT INTO `history` (historydate, charnameid, locationid, goldrec, material) VALUES ('$treasdate', $toonid, $locid, $gold, $matid)";
  23. if (!$result = $con->query($sqlmatins)){
  24. die ('There was an error running the query [' . $con->error . ']');
  25. }
  26. } else if ($droptype == 3){
  27. $runeid = mysqli_real_escape_string($con, $_POST['rune']);
  28. $runerare = mysqli_real_escape_string($con, $_POST['runerarity']);
  29. $sqlruneins = "INSERT INTO `history` (historydate, charnameid, locationid, goldrec, itemtype, itemrarity, runetype) VALUES ('$treasdate', $toonid, $locid, $gold, '16', $runerare, $runeid)";
  30. if (!$result = $con->query($sqlruneins)){
  31. die ('There was an error running the query [' . $con->error . ']');
  32. }
  33. } else {
  34. echo 'No data was sent!<BR />';
  35. }
  36. echo '<BR />Return to <A HREF="gw-record.php">data recording</A> page<BR /><BR />';
  37. echo 'Go to <A HREF="gw-toon.php">character selection</A>';
  38. # humans shouldn't actually see this page, will need to auto submit this form back to gw-toon.php using the POST data name of "cname" so the previous toon will be auto selected
  39. # or look into using cookies / sessions (sessions being preferable)
  40. ?>