mysql_query("INSERT INTO favorites (uid,tid) VALUES (" . $user->uid . "," . $_REQUEST['tid'] . ");"); } else { if ($_REQUEST['method'] == 'del') { mysql_query("DELETE FROM favorites WHERE uid = " . $user->uid . " AND tid = " . $_REQUEST['tid'] . " LIMIT 1"); } } break; case 'SwitchReliable': if (!is_numeric($_REQUEST['rid'])) { exit; } if (!in_array($_REQUEST['reliable'], array('i', 'n', '?', 'e'))) { exit; } $remark = new Remark($_REQUEST['rid']); $remark->changeReliability($_REQUEST['reliable']); break; case 'CheckUsername': if (CheckUsername($_REQUEST['text'])) { echo 1; } else { echo 0; } break; case 'Exit': quit(); addMessage('Sikeresen kiléptünk!', 'info'); break; default: return json_encode($_REQUEST); //code to be executed if n is different from all labels;