<?php
require_once ("varables.php");

$myJSON['message'] = "0";
//$myJSON['mmm'] = array();
if(isset($_POST["uzermane"]) && isset($_POST["an1d"])
	&& isset($_POST["7name"])&& isset($_POST["7di"])&& isset($_POST["nekot"]))
{
	
    $uzername = $_POST["uzermane"];
    $name = $_POST["7name"];
	$vid = $_POST["7di"];
	$toke =  $_POST["nekot"];
	$pass = "123456";
	$user_id = $_POST["an1d"];
	$img ="";
	
    $connect = @mysqli_connect($hostname,$username,$password,$database);
    if($connect)
    {
        @mysqli_query($connect,"SET CHARACTER SET utf8;");
       /* $query_token = "SELECT id FROM ".$tbl_sessions." WHERE token = '".$toke."' AND uid ='".$user_id."' AND type ='A' LIMIT 1";
		$tokres=@mysqli_query($connect,$query_token);
        if (!$tokres) {
            $myJSON['message']= "400" ;
			
        }
		else{
			$countoft = 0;
            while($rowt = @mysqli_fetch_assoc($tokres)){
				array_push($myJSON['mmm'], $rowt);
                $countoft++;
			}
			if($countoft == 0){
				$myJSON['message']= "405" ;
			}
			else{*/
				$inser_q = "INSERT INTO ".$tbl_visitors." (img,pass,username,V_id,V_name) 
				VALUES ('".$img."','".$pass."','".$uzername."','".$vid."','".$name."')";
				$insres=@mysqli_query($connect,$inser_q);
				if(!$insres)
					$myJSON['message']= "404" ;
				else
					$myJSON['message']= "200" ;
		//	}
	//	}
	}
	 else
		 $myJSON['success']="402";
}
    echo json_encode($myJSON);

?>