Commit 28492b8a by nadeem.qasmi

location fix php 2

parent 84d87630
Pipeline #513 passed with stage
in 0 seconds
...@@ -398,27 +398,8 @@ $selected_id = isset( $_GET['course'] ) ? $_GET['course'] : - 1; ...@@ -398,27 +398,8 @@ $selected_id = isset( $_GET['course'] ) ? $_GET['course'] : - 1;
</div> </div>
<?php <?php
function get_client_ip_server() { $ip = file_get_contents('https://api.ipify.org');
$ipaddress = ''; //echo "My public IP address is: " . $ip;
if ($_SERVER['HTTP_CLIENT_IP'])
$ipaddress = $_SERVER['HTTP_CLIENT_IP'];
else if($_SERVER['HTTP_X_FORWARDED_FOR'])
$ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
else if($_SERVER['HTTP_X_FORWARDED'])
$ipaddress = $_SERVER['HTTP_X_FORWARDED'];
else if($_SERVER['HTTP_FORWARDED_FOR'])
$ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];
else if($_SERVER['HTTP_FORWARDED'])
$ipaddress = $_SERVER['HTTP_FORWARDED'];
else if($_SERVER['REMOTE_ADDR'])
$ipaddress = $_SERVER['REMOTE_ADDR'];
else
$ipaddress = 'UNKNOWN';
return $ipaddress;
}
$Ipx = get_client_ip_server();
?> ?>
...@@ -428,7 +409,7 @@ $Ipx = get_client_ip_server(); ...@@ -428,7 +409,7 @@ $Ipx = get_client_ip_server();
var ips ='00'; var ips ='00';
ips = '<?php echo ($Ipx); ?>'; ips = '<?php echo ($ip); ?>';
console.log(ips); console.log(ips);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment