*

MB Themes

Re: Determine my location
« Reply #15 on: June 07, 2022, 04:24:27 PM »
Well you must enable error log to see what error it is.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Vlad7

  • ****
  • 244 posts
Re: Determine my location
« Reply #16 on: June 07, 2022, 04:43:01 PM »
cPanel has no errors for this site

*

Vlad7

  • ****
  • 244 posts
Re: Determine my location
« Reply #17 on: June 07, 2022, 07:37:47 PM »
Journal in Osclass?
« Last Edit: June 07, 2022, 08:00:33 PM by Vlad7 »

*

Vlad7

  • ****
  • 244 posts
Re: Determine my location
« Reply #18 on: June 07, 2022, 09:06:13 PM »
Well you must enable error log to see what error it is.

Let me know am I on the right track? :(

*

mwindey

  • *****
  • 475 posts
Re: Determine my location
« Reply #19 on: June 07, 2022, 10:58:30 PM »
When this is in functions.php it shows location but I am not able to put it in front.<?php   

function get_client_ip()
{
    $ipaddress = '';
    if (isset($_SERVER['HTTP_CLIENT_IP'])) {
        $ipaddress = $_SERVER['HTTP_CLIENT_IP'];
    } else if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
        $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
    } else if (isset($_SERVER['HTTP_X_FORWARDED'])) {
        $ipaddress = $_SERVER['HTTP_X_FORWARDED'];
    } else if (isset($_SERVER['HTTP_FORWARDED_FOR'])) {
        $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];
    } else if (isset($_SERVER['HTTP_FORWARDED'])) {
        $ipaddress = $_SERVER['HTTP_FORWARDED'];
    } else if (isset($_SERVER['REMOTE_ADDR'])) {
        $ipaddress = $_SERVER['REMOTE_ADDR'];
    } else {
        $ipaddress = 'UNKNOWN';
    }

    return $ipaddress;
}
$PublicIP = get_client_ip();
$json     = file_get_contents("http://ipinfo.io/$PublicIP/geo");
$json     = json_decode($json, true);
$country  = $json['country'];
$region   = $json['region'];
$city     = $json['city'];
?>
« Last Edit: June 07, 2022, 11:07:55 PM by mwindey »

*

Vlad7

  • ****
  • 244 posts
Re: Determine my location
« Reply #20 on: June 07, 2022, 11:03:24 PM »
functions.php <?php   

function get_client_ip()
{
    $ipaddress = '';
    if (isset($_SERVER['HTTP_CLIENT_IP'])) {
        $ipaddress = $_SERVER['HTTP_CLIENT_IP'];
    } else if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
        $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
    } else if (isset($_SERVER['HTTP_X_FORWARDED'])) {
        $ipaddress = $_SERVER['HTTP_X_FORWARDED'];
    } else if (isset($_SERVER['HTTP_FORWARDED_FOR'])) {
        $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];
    } else if (isset($_SERVER['HTTP_FORWARDED'])) {
        $ipaddress = $_SERVER['HTTP_FORWARDED'];
    } else if (isset($_SERVER['REMOTE_ADDR'])) {
        $ipaddress = $_SERVER['REMOTE_ADDR'];
    } else {
        $ipaddress = 'UNKNOWN';
    }

    return $ipaddress;
}
$PublicIP = get_client_ip();
$json     = file_get_contents("http://ipinfo.io/$PublicIP/geo");
$json     = json_decode($json, true);
$country  = $json['country'];
$region   = $json['region'];
$city     = $json['city'];
?>

what is this? please explain.

*

mwindey

  • *****
  • 475 posts
Re: Determine my location
« Reply #21 on: June 07, 2022, 11:26:33 PM »
@Vlad7

It determines clients ip country province and state ... put it in functions.php but i am not able to get it in search results yet..
Code: [Select]
<?php   

function get_client_ip()
{
    
$ipaddress '';
    if (isset(
$_SERVER['HTTP_CLIENT_IP'])) {
        
$ipaddress $_SERVER['HTTP_CLIENT_IP'];
    } else if (isset(
$_SERVER['HTTP_X_FORWARDED_FOR'])) {
        
$ipaddress $_SERVER['HTTP_X_FORWARDED_FOR'];
    } else if (isset(
$_SERVER['HTTP_X_FORWARDED'])) {
        
$ipaddress $_SERVER['HTTP_X_FORWARDED'];
    } else if (isset(
$_SERVER['HTTP_FORWARDED_FOR'])) {
        
$ipaddress $_SERVER['HTTP_FORWARDED_FOR'];
    } else if (isset(
$_SERVER['HTTP_FORWARDED'])) {
        
$ipaddress $_SERVER['HTTP_FORWARDED'];
    } else if (isset(
$_SERVER['REMOTE_ADDR'])) {
        
$ipaddress $_SERVER['REMOTE_ADDR'];
    } else {
        
$ipaddress 'UNKNOWN';
    }

    return 
$ipaddress;
}
$PublicIP get_client_ip();
$json     file_get_contents("http://ipinfo.io/$PublicIP/geo");
$json     json_decode($jsontrue);
$country  $json['country'];
$region   $json['region'];
$city     $json['city'];
?>


*

Vlad7

  • ****
  • 244 posts
Re: Determine my location
« Reply #22 on: June 07, 2022, 11:36:57 PM »
No, total fall.

*

Vlad7

  • ****
  • 244 posts
Re: Determine my location
« Reply #23 on: June 07, 2022, 11:41:30 PM »
I contacted my hosting provadur, they have no problem. Questions only to the developers of the theme template.

*

Vlad7

  • ****
  • 244 posts
Re: Determine my location
« Reply #24 on: June 07, 2022, 11:51:12 PM »
Error log included, see.

*

MB Themes

Re: Determine my location
« Reply #25 on: June 08, 2022, 09:04:25 AM »
@Vlad7
Queries are OK, you had error 500 that represents some PHP errors.
https://docs.osclasspoint.com/debug-php-errors
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Vlad7

  • ****
  • 244 posts
Re: Determine my location
« Reply #26 on: June 08, 2022, 01:02:01 PM »
If everything is in order, why doesn't it work for me!!!?

*

mwindey

  • *****
  • 475 posts
Re: Determine my location
« Reply #27 on: June 08, 2022, 03:42:45 PM »
https://www.etutorialspoint.com/index.php/24-visitors-location
I am trying to implement it myself and maybe MB Themes can help us on this...
« Last Edit: June 08, 2022, 03:44:32 PM by mwindey »

*

MB Themes

Re: Determine my location
« Reply #28 on: June 09, 2022, 08:22:57 AM »
I think we should stop here, step out, look on issue and start again.

...
...
...

Open this page:
https://ukagro.com.ua/index.php?ajaxRequest=1&ajaxFindCity=1&latitude=48.971678&longitude=21.7104383

If you enable error logging, instead "HTTP ERROR 500" you should see error details. We need those details.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Vlad7

  • ****
  • 244 posts
Re: Determine my location
« Reply #29 on: June 09, 2022, 03:48:29 PM »
hello, the magazine is on. Here is what I get