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.
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

39 řádky
2.4 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. $toonid = $_SESSION['playerid'];
  10. $treasdate = mysqli_real_escape_string($con, $_POST['treasuredate']);
  11. if ($droptype == 1){
  12. $rarity = mysqli_real_escape_string($con, $_POST['rare']);
  13. $req = mysqli_real_escape_string($con, $_POST['requirement']);
  14. $attrib = mysqli_real_escape_string($con, $_POST['attribute']);
  15. $weap = mysqli_real_escape_string($con, $_POST['weapon']);
  16. $itname = mysqli_real_escape_string($con, $_POST['itemname']);
  17. $sqlweapins = "INSERT INTO `history` (historydate, charnameid, locationid, goldrec, itemreq, itemtype, itemattribute, itemrarity, itemname) VALUES ('$treasdate', $toonid, $locid, $gold, $req, $weap, $attrib, $rarity, '$itname')";
  18. if (!$result = $con->query($sqlweapins)){
  19. die ('There was an error running the query [' . $con->error . ']');
  20. }
  21. } else if ($droptype == 2){
  22. $matid = mysqli_real_escape_string($con, $_POST['rarematerial']);
  23. $sqlmatins = "INSERT INTO `history` (historydate, charnameid, locationid, goldrec, material) VALUES (\"$treasdate\", $toonid, $locid, $gold, $matid)";
  24. if (!$result = $con->query($sqlmatins)){
  25. die ('There was an error running the query [' . $con->error . ']');
  26. }
  27. } else if ($droptype == 3){
  28. $runeid = mysqli_real_escape_string($con, $_POST['rune']);
  29. $runerare = mysqli_real_escape_string($con, $_POST['runerarity']);
  30. $sqlruneins = "INSERT INTO `history` (historydate, charnameid, locationid, goldrec, itemtype, itemrarity, runetype) VALUES ('$treasdate', $toonid, $locid, $gold, '16', $runerare, $runeid)";
  31. if (!$result = $con->query($sqlruneins)){
  32. die ('There was an error running the query [' . $con->error . ']');
  33. }
  34. } else {
  35. exit("Variable droptype was set to ($droptype)");
  36. }
  37. echo '<BODY onload="document.returntotoons.submit()">';
  38. echo '<FORM METHOD="POST" ACTION="gw-toon.php" NAME="returntotoons"><INPUT TYPE="HIDDEN" NAME="cnameid" VALUE="'. $toonid . '"><INPUT TYPE="SUBMIT"></FORM></BODY>';
  39. ?>