<?php

		include('browser.php');
		$br  		= new Browser();
		$plf 		= $br->getPlatform();
		$brw 		= $br->getBrowser();
		$brv 		= $br->getVersion();

		// IP
		$sip		= $_SERVER['REMOTE_ADDR'];
		
		// URL
		$page_url 	= (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
		
		// USER
		$cookie_name = "xuid_ck";
		$usname 	= $_COOKIE[$cookie_name];
		
include('r_dbc.php');

$sql = "INSERT INTO view_stats (vdate,uip,platform,browser,version,cuser,pid,curl)
				SELECT now(),'$sip','$plf','$brw','$brv','$usname','$pid','$page_url'";
		
		// echo $sql;
		$result = mysqli_query($conn, $sql);

mysqli_close($conn);		

?>