Как переделать в простую ссылку на лайк?
if(isset($_POST['golos'])){
$post = $_POST['rating'];
$rat=mysql_fetch_assoc(mysql_query("SELECT * FROM `games` WHERE `id` = '".intval($_GET['id'])."' AND `id` = '".$info_game['id']."' LIMIT 1"
);
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `golos_chek` WHERE `ip` = '".$_SERVER['REMOTE_ADDR']."' AND `id_post` = '".$rat['id']."'"
, 0)==0 && $rat['ip']!=$_SERVER['REMOTE_ADDR']){
mysql_query("UPDATE `games` SET `$post` = '".($rat[$post]+1)."' WHERE `id` = '".$rat['id']."' LIMIT 1"
;
mysql_query("INSERT INTO `golos_chek` (`ip`, `id_post`, `rating`) values('".$_SERVER['REMOTE_ADDR']."', '".$rat['id']."','1')"
;
header('location: /info/'.$info_game['id'].'');
}
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `golos_chek` WHERE `ip` = '".$_SERVER['REMOTE_ADDR']."' AND `id_post` = '".$rat['id']."'"
, 0)==0 && $rat['ip']!=$_SERVER['REMOTE_ADDR']){
echo '<form action="" method="POST">
<input type="radio" name="rating" value="like" checked="checked" /> Да<br/>
<input type="radio" name="rating" value="dislake" /> Нет <br/>
<input type="submit" value="Голосовать" name="golos" />
</form>';
}