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ů.
 
 
 

49 řádky
2.4 KiB

  1. <!DOCTYPE html>
  2. <HTML>
  3. <HEAD>
  4. <TITLE>Inserting Data</TITLE>
  5. </HEAD>
  6. <?php
  7. session_start();
  8. include_once 'gw-connect.php';
  9. $con = new mysqli(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME);
  10. #non-section specific POST data here
  11. $gold = mysqli_real_escape_string($con, $_POST['droppedgold']); //how much gold dropped
  12. $droptype = mysqli_real_escape_string($con, $_POST['droptype']); //this dictates if the drop was a weapon/rune/material
  13. $locid = mysqli_real_escape_string($con, $_POST['location']); //this is `treasurelocation`.`treasureid` in the database
  14. $toonid = $_SESSION['playerid'];
  15. $uid = $_SESSION['userid'];
  16. $treasdate = mysqli_real_escape_string($con, $_POST['treasuredate']);
  17. if ($droptype == 1){
  18. $rarity = mysqli_real_escape_string($con, $_POST['rare']);
  19. $req = mysqli_real_escape_string($con, $_POST['requirement']);
  20. $attrib = mysqli_real_escape_string($con, $_POST['attribute']);
  21. $weap = mysqli_real_escape_string($con, $_POST['weapon']);
  22. $itname = mysqli_real_escape_string($con, $_POST['itemname']);
  23. $sqlweapins = "INSERT INTO `history` (historydate, userid, charnameid, locationid, goldrec, itemreq, itemtype, itemattribute, itemrarity, itemname) VALUES ('$treasdate', $uid, $toonid, $locid, $gold, $req, $weap, $attrib, $rarity, '$itname')";
  24. if (!$result = $con->query($sqlweapins)){
  25. die ('There was an error running the query [' . $con->error . ']');
  26. }
  27. } else if ($droptype == 2){
  28. $matid = mysqli_real_escape_string($con, $_POST['rarematerial']);
  29. $sqlmatins = "INSERT INTO `history` (historydate, charnameid, locationid, goldrec, material) VALUES ('$treasdate', $toonid, $locid, $gold, $matid)";
  30. if (!$result = $con->query($sqlmatins)){
  31. die ('There was an error running the query [' . $con->error . ']');
  32. }
  33. } else if ($droptype == 3){
  34. $runeid = mysqli_real_escape_string($con, $_POST['rune']);
  35. $runerare = mysqli_real_escape_string($con, $_POST['runerarity']);
  36. $sqlruneins = "INSERT INTO `history` (historydate, charnameid, locationid, goldrec, itemtype, itemrarity, runetype) VALUES ('$treasdate', $toonid, $locid, $gold, '16', $runerare, $runeid)";
  37. if (!$result = $con->query($sqlruneins)){
  38. die ('There was an error running the query [' . $con->error . ']');
  39. }
  40. } else {
  41. exit("Variable droptype was set to ($droptype)");
  42. }
  43. ?>
  44. <BODY onload="document.returntotoons.submit()">
  45. <FORM METHOD="POST" ACTION="gw-toon.php" NAME="returntotoons">
  46. <INPUT TYPE="SUBMIT">
  47. </FORM>
  48. </BODY>
  49. </HTML>