View file wu-engine/wu-actions/eshop_fav_add.php

File size: 662B
<?php
require_once('../wu_init.php');
if (!wu_token()) { exit('wu-error'); }
if (!USER_LOGGED) { exit('3'); }

if(isset($_POST['id'])){
if(!empty($_POST['id'])){
$id = intval($_POST['id']);
$qu = mysqli_fetch_assoc(mysqli_query($connect_db, "SELECT id,usr FROM ".DB_PREFIX."_es WHERE id='$id' LIMIT 1"));
$usr = $qu['usr'];
if (empty($usr)) { exit('3'); }
$how = mysqli_num_rows(mysqli_query($connect_db, "SELECT id FROM ".DB_PREFIX."_es_f WHERE usr='$u_id' AND f='$id' LIMIT 1"));
if ($how > 0) { exit('0'); }
mysqli_query($connect_db, "INSERT INTO `".DB_PREFIX."_es_f` (usr,f) VALUES ('$u_id','$id')");
exit('1');
} else { exit('3'); }
} else { exit('3'); }
?>