Sfoglia il codice sorgente

i wonder what I broke

should insert a "Nothing dropped!" and 0 gold pieces into the database in the event a player visits a location before the 30 days is up. Also hopefully included a working todays date + 30 days from now date to let the player know when to return again.
development
mauirixxx 8 anni fa
parent
commit
a56c50dc1d
2 ha cambiato i file con 7 aggiunte e 1 eliminazioni
  1. +6
    -0
      gw-insert.php
  2. +1
    -1
      gw-record.php

+ 6
- 0
gw-insert.php Vedi File

@@ -38,6 +38,12 @@ if ($droptype == 1){
if (!$result = $con->query($sqlruneins)){
die ('There was an error running the query [' . $con->error . ']');
}
} else if ($droptype == 4){
$itname = mysqli_real_escape_string($con, $_POST['itemname']);
$sqlnothing = "INSERT INTO `history` (historydate, charnameid, locationid, goldrec, itemname) VALUES ('$treasdate', $uid, $toonid, $locid, $gold, '$itname')";
if (!$result = $con->query($sqlnothing)){
die ('There was an error running the query [' . $con->error . ']');
}
} else {
exit("Variable droptype was set to ($droptype)");
}


+ 1
- 1
gw-record.php Vedi File

@@ -124,7 +124,7 @@ if ($whatdropped == "1"){
} else if ($whatdropped == "4"){
echo '<CENTER><FORM METHOD="POST" ACTION="gw-insert.php">';
echo 'on <INPUT NAME="treasuredate" TYPE="DATE" PLACEHOLDER="2006-10-26"> nothing dropped! Maybe try again in 30 days on the: ' . date('Y-m-d', strtotime("+30 days"));
echo '<INPUT TYPE="HIDDEN" NAME="droppedgold" VALUE="0">';
echo '<INPUT TYPE="HIDDEN" NAME="droppedgold" VALUE="0"><INPUT TYPE="HIDDEN" NAME="itemname" VALUE="Nothing dropped!">';
echo '<INPUT TYPE="HIDDEN" NAME="droptype" VALUE="4"><INPUT TYPE="HIDDEN" NAME="location" VALUE="' . $locid .'">';
echo '<INPUT TYPE="HIDDEN" NAME="chartoon" VALUE="' . $toonid .'">';
echo ' <BR /><INPUT TYPE="SUBMIT" VALUE="Click me!"></FORM></CENTER><BR />';


Caricamento…
Annulla
Salva