<?php
include('../inc/conf.php');
ini_set('session.use_cookies', 'On');
ini_set('session.use_trans_sid', 'Off');
session_set_cookie_params(604800000, "/", SITE, false, false);
session_start();
if (!isset($_SESSION["uid"])){
echo "2";
exit;
}
$usr = intval($_SESSION["uid"]);
if($_POST['stomail'] == 'true'){
mysqli_query($connect_db, "UPDATE `t_users` SET `tm` = '1' WHERE uid = '$usr'");
echo '1';
} else {
mysqli_query($connect_db, "UPDATE `t_users` SET `tm` = '0' WHERE uid = '$usr'");
echo '0';
}
?>