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.
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

52 lines
2.5 KiB

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