<?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['payeer'])){
if(!empty($_POST['payeer'])){
$payeer = mysqli_real_escape_string($connect_db, trim($_POST['payeer']));
if(strlen($payeer) < '3'){ echo '0'; exit; }
$usr = intval($_SESSION["uid"]);
$np = mysqli_fetch_assoc(mysqli_query($connect_db, "SELECT pa FROM t_users WHERE uid = '$usr'"));
$nowp = $np['pa'];
if ($nowp == $payeer) { echo '5'; exit; }
mysqli_query($connect_db, "UPDATE `t_users` SET `pa` = '$payeer' WHERE uid = '$usr'");
echo '1';
} else { echo '4'; }
} else { echo '3'; }
?>