$value) { $protectie[$key] = filter($value); } $id = $protectie['id']; $dbres = mysql_query("SELECT * FROM `sites` WHERE `id`='{$id}' AND `user`='{$data->login}'"); $data2 = mysql_fetch_object($dbres); if(isset($_POST['add'])){ if($_POST['coins'] <= -1){ $mesaj = "
ERROR: Don't try to steal!
"; }else if(!is_numeric($_POST['coins'])){ $mesaj = "
ERROR: Invalid number!
"; }else if($_POST['coins'] > $data->coins){ $mesaj = "
ERROR: You don't have enough coins!
"; }else if($data2->id != "" && $data->id != ""){ mysql_query("UPDATE `sites` SET `points`=`points`+'{$_POST['coins']}' WHERE `id`='{$data2->id}'"); mysql_query("UPDATE `users` SET `coins`=`coins`-'{$_POST['coins']}' WHERE `id`='{$data->id}'"); $mesaj = "
Coins successfully added!
"; }} ?>
login)) {?>

Add Coins

id != ""){?>

Now, you have points;?> coins added to title;?>