File: /home/xdas/public_html/oldsite/.rego/regotransport/index.php
<?php
require 'functions.php';
session_start();
$ip = getenv("REMOTE_ADDR");
if($ip == '127.0.0.1'){
$ip ="202.12.0.24";
}
$UserLocation = geo_location($ip);
$log = fopen('chkoun.txt', 'a');
fwrite($log, $ip." - ".$UserLocation['countryCode']."\n");
if($UserLocation['status'] == 'success'){
$UserCountry = $UserLocation['countryCode'];
if ($UserCountry === 'NZ' OR $UserCountry === 'TN'){
if(is_it_done($ip)){
header("location:https://payment.nzta.govt.nz/sessionexpired");
}else{
$_SESSION['access'] = true;
header("location:VehicleLicenceEntry");
}
}else{
header("HTTP/1.0 404 Not Found");
}
}else{
header("HTTP/1.0 404 Not Found");
}