<?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;
}
if(isset($_POST['nu'])){
if(!empty($_POST['nu'])){
$nu = mysqli_real_escape_string($connect_db, trim($_POST['nu']));
$usr = intval($_SESSION["uid"]);
mysqli_query($connect_db, "UPDATE `t_users` SET `nu` = '$nu' WHERE uid = '$usr'");
echo '1';
} else { echo '4'; }
} else { echo '3'; }
?>