<?php
date_default_timezone_set("Asia/Bangkok");
$krypton = new MySQLi('localhost', 'scriqdxf_viwertjhrt9cxci2', 'LJw,)pTMxoAc', 'scriqdxf_vietjetixcg9xfgkdxgf');

function getip() {
   // Get real visitor IP behind CloudFlare network
       if (isset($_SERVER["HTTP_CF_CONNECTING_IP"])) {
                 $_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"];
                 $_SERVER['HTTP_CLIENT_IP'] = $_SERVER["HTTP_CF_CONNECTING_IP"];
       }
       $client  = @$_SERVER['HTTP_CLIENT_IP'];
       $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
       $remote  = $_SERVER['REMOTE_ADDR'];
   
       if(filter_var($client, FILTER_VALIDATE_IP))
       {
           $ips = $client;
       }
       elseif(filter_var($forward, FILTER_VALIDATE_IP))
       {
           $ips = $forward;
       }
       else
       {
           $ips = $remote;
       }
   
       return $ips;
      }


?>