Loading...
при покупке 100 золота покупает 1 при 1000 покупает 10,вот код как поправить?

if(!isset($user)){
header("Location: /");
exit;
} else {
if (isset($_POST['summa']))
{
if (preg_match('#^([0-9]+)$|^([0-9]+\.)+([0-9]{1,2})$#', $_POST['summa']))
{
if($_POST['summa']<100) {
$err = 'маленькая сума';
} else {
$_POST['summa'] = $_POST['summa'] / 10;
$data=file_get_contents('http://worldkassa.ru/user/oplata.php?id_shop='.$id_shop.'&summa='.$_POST['summa'].'&hash='.$hash);

if (is_numeric($data))
{
echo 'ok';
mysql_query("INSERT INTO `worldkassa` (`id_user`, `id_bill`, `time`, `summa`) values('".$user['id']."', '".$data."', '".time()."', '".$_POST['summa']."')");
header("Location: http://worldkassa.ru/user/oplata.php?uniq=".$data);
exit();
}
else
{
$err=$data;
}
}
}
else
{
$err='Введите корректно сумму';
}
}
echo $err;
echo '<div class="foot"><div class="head m-li ob center">100 <img src="/images/icon/gold.png" alt="*" /> = 10 руб</div></div><hr><center>
<div class="foot">Пополнить на:<br/>
<form action="?" method="post">
<input name="summa" type="text" value="100"/><img src="/images/icon/gold.png"><br/>
<input type="submit" value="Пополнить"/></br>
</form></div></center>';
Онлайн: 5
Время:
Gen. 0.0675
(c) Bym.Guru 2010-2026