Okay I think we can agree that detecting what plug-ins are used isn't going to help..
Also the problem is people are changing values and get extra goodies, So how to deal with it,
I have created a simple example shop, to help explain the problem and the solution,
the below code is a gun shop for a game, now to keep it simple I have used GET instead of post,
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Gun shop</title>
</head>
<body>
<?php
$money = 75;
$items = array(
1 => array("Name" => "small gun", "Price" => 10),
2 => array("Name" => "medium gun", "Price" => 50),
3 => array("Name" => "large gun", "Price" => 100)
);
//Purchase
if(!empty($_GET['do']) && !empty($_GET['id']) && $_GET['do'] == 'purchase'){
echo "<p>You have purchased the ".$items[$_GET['id']]['Name']."</p>";
}
foreach($items as $id => $item){
echo $item['Name'];
if($item['Price'] <= $money){
echo ' <a href="?do=purchase&id='.$id.'">Buy Now</a>';
}else{
echo ' <a href="javascript:alert(\'Need more money\');">need more funds</a>';
}
echo "<br />";
}
?>
</body>
</html>
Now if you click on the small gun "buy now" it tell you you have purchased it, yay,
same for the medium gun.. but if you want the large.. no joy..
BUT if you just change the id to 3 on the URL (or in your case changed a value in a form via whatever method) your see you can buy the large gun..
So how do we stop that.. well the display is only to help the user choose, you should never work under the impression that if you don't display something then its secure, as its NOT..
So to plug our exploit, we need to check if they have the money after the get/post same as we checked when we displayed it,
So now if you change
//Purchase
if(!empty($_GET['do']) && !empty($_GET['id']) && $_GET['do'] == 'purchase'){
echo "<p>You have purchased the ".$items[$_GET['id']]['Name']."</p>";
}
to
//Purchase
if(!empty($_GET['do']) && !empty($_GET['id']) && $_GET['do'] == 'purchase'){
if($items[$_GET['id']]['Price'] <= $money){ //Added IF statement
echo "<p>You have purchased the ".$items[$_GET['id']]['Name']."</p>";
}
}
your find you can no longer get the large gun,
Hope that helps
EDIT:
Now just say you your shop will display a random item with the option to buy it, then your need to check that, that item was on offer to that user, so save its ID in a session or a database whatever.. just somewhere the user can't access,