diff options
Diffstat (limited to 'inc')
-rw-r--r-- | inc/mine.inc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/inc/mine.inc b/inc/mine.inc index 76c0055..aea04ad 100644 --- a/inc/mine.inc +++ b/inc/mine.inc @@ -5,13 +5,14 @@ function initCraftMine() { } function withdrawMine() { - $mine = $_SESSION["mine"]; - $_SESSION["mine"]["gold"] += $mine["mine"]; - $_SESSION["mine"]["mine"] = 0; + $amount = intval($_POST["amount"]); + if($amount == 0) return; + $_SESSION["mine"]["gold"] += $amount; + echo $_SESSION["mine"]["gold"]; } function sendMine() { - if(empty($_SESSION["mine"])) initMine(); + if(empty($_SESSION["mine"])) initCraftMine(); $mine = $_SESSION["mine"]; echo $mine["gold"]; } |