Our Scripts Vault contains many game scripts that you can use to create your own game!
$cost = $getspy1['level'] * 2000; $spyid = $getspy1['id']; echo "<form method=\"post\" action=\"spylog.php?act=confirm\">"; echo "<input type=\"hidden\" name=\"cost\" value=\"$cost\">"; echo "<input type=\"hidden\" name=\"spyid\" value=\"$spyid\">"; echo "<input type=\"submit\" name=\"yes\" value=\"Yes, I am sure!\">"; echo "</form>";
<?php$cost = $getspy1['level'] * 2000;$spyid = $getspy1['id'];if($_POST){$confirm_cost = $getspy1['level'] * 2000;if($cost != $confirm_cost){$error=" Whatever error you like to put."}} echo "<span> $error</span><form method=\"post\" action=\"spylog.php?act=confirm\"><input type=\"hidden\" name=\"cost\" value=\"$cost\"><input type=\"hidden\" name=\"spyid\" value=\"$spyid\"><input type=\"submit\" name=\"yes\" value=\"Yes, I am sure!\"></form>";?>
if(isset($_POST)){ //Stuff}
Why do you include those values as a hidden form field?It seems you can calculate those values using PHP, so you don't need to rely on hidden input fields.
$cost = $getspy1['level'] * 2000; $spyid = $getspy1['id']; echo "<strong>SPY:</strong> So you want some information on\n" . $getspy1['username'] . "<br>"; echo "<strong>SPY:</strong> Well that's going to cost you some cash!<br>"; echo "<strong>YOU:</strong> How much is this gonna cost<br>"; echo "<strong>SPY</strong> For this player it will cost $" . $cost . "<br>"; echo "<strong>SPY</strong> So you want me to spy on this guy?"; echo "<form method=\"post\" action=\"spylog.php?act=confirm\">"; echo "<input type=\"hidden\" name=\"spyid\" value=\"$spyid\">"; echo "<input type=\"submit\" name=\"yes\" value=\"Yes, I am sure!\">"; echo "</form>";
$spycost = //get user level * 2000
$spyid=stripslashes($_POST['spyid']); $getspyconfirm = $db->execute("SELECT `id`, `username`, `level` FROM `players` where `id`=?", array($spyid)); $getspyconfirm1 = $getspyconfirm->fetchrow(); $spycost = $getspyconfirm1['level'] * 2000; $spyinfo = $db->execute("SELECT `id`, `username`, `level`, `vitality`, `strength`, `agility`, `gold` FROM `players` where `id`=?", array($spyid)); $spyinfo1 = $spyinfo->fetchrow(); $getweapons = $db->execute("SELECT i.item_id, i.player_id, i.status, b.id, b.name, b.type FROM items i INNER JOIN blueprint_items b on b.id = i.item_ID where i.player_id=? and i.status=? and b.type=?", array($spyid, 'equipped', 1 or 2));