Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6550865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:16:03+00:00 2026-05-25T12:16:03+00:00

I have been removing our website from wordpress onto its own platform. Temporarily I

  • 0

I have been removing our website from wordpress onto its own platform. Temporarily I wanted to access the maps api from google using an XML feed loaded in a PHP file on the wordpress side. Accessing this from the offline testing page of the new platform is rendering.

URL file-access is disabled in the server configuration

The following page should instead render directions from the XML feed. Try it for yourself. http://www.golfbrowser.com/wp-content/themes/light/utilities/directions.php?start=RG426ly&end=SL42ES

The PHP looks like this,

<?php 

$start = $_POST['start'];
$end = $_POST['end'];

$xml = simplexml_load_file('http://maps.googleapis.com/maps/api/directions/xml?origin='.$start.'&destination='.$end.'&sensor=false');


// data to fetch
$startlat = $xml->xpath("/DirectionsResponse/route/leg/start_location/lat");
$startlng = $xml->xpath("/DirectionsResponse/route/leg/start_location/lng");
$endlat = $xml->xpath("/DirectionsResponse/route/leg/end_location/lat");
$endlng = $xml->xpath("/DirectionsResponse/route/leg/end_location/lng");


$start = $xml->xpath("/DirectionsResponse/route/leg/start_address");
$end = $xml->xpath("/DirectionsResponse/route/leg/end_address");

$start = (string)$start[0];
$end = (string)$end[0];

$startlat = (string)$startlat[0];
$startlng = (string)$startlng[0];

$endlat = (string)$endlat[0];
$endlng = (string)$endlng[0];


// Route Information

$distance = $xml->xpath("/DirectionsResponse/route/leg/distance/value");
$duration = $xml->xpath("/DirectionsResponse/route/leg/duration/value");

$distance = (string)$distance[0];
$duration = (string)$duration[0];

$duration = round(($duration / 60), 0);

if ($duration > 60)
{
  $hours = round(($duration / 60),0). ' hour and ';
  $minutes = $duration % 60 . ' minutes';
}
if ($duration == 60)
{
  $hours = round(($duration / 60),0). ' hour';
  $minutes == '';
}
if ($duration >= 120)
{
  $hours = round(($duration / 60),0). ' hours and ';
  $minutes = $duration % 60 . ' minutes';
}
if ($duration < 60)
{
   $minutes = $duration % 60 . ' minutes';
}

$distancekm = round(($distance * 0.001), 1);
$distancem = round(($distance * 0.000621371192), 1);


// Directions

$directions = $xml->xpath("/DirectionsResponse/route/leg/step");





// Compilation

$outputo = '
<li class="dirtotal"><b>Route Overview</b><br>'.$distancem.' miles ('.$distancekm.' km) <br />about '.$hours.' '.$minutes.'</li>';

$outputs = '<li class="dirstart" value="'.$endlat.', '.$endlng.'"><b>'.$start.'</b></li>';

$output = '';
$distancem = '';
$distancekm = '';
$duration = '';

$order = 0;

foreach ($directions as $direct) {

    $latitude = $direct->start_location->lat;
    $longitude = $direct->start_location->lng;

    $output .= '<li class="dir" value="'.$endlat.', '.$endlng.'"><span class="tit">'. $order += 1 .'</span>';

    if($distancekm != '') {

    $latlong = $latitude.', '.$longitude;

    $output .= '<div>Drive '.$distancem.' miles ('.$distancekm.' km) then';

    }
    else {
        $output .= '<div>';
    }

    $instructions = $direct->html_instructions;
    $duration = $direct->duration->value;
    $distance = $direct->distance->value;

    $distancekm = round(($distance * 0.001), 1);
    $distancem = round(($distance * 0.000621371192), 1);


    $output .= '<b>'.$instructions.'</b></div><span class="end"></span></li>';

}

$outpute =
'<li class="dirend" value="'.$endlat.', '.$endlng.'"><b>'.$end.'</b></li>';


// output

$outputs = $outputo.$outputs.$output.$outpute;

echo $outputs;


?>

Any ideas why its doing this now?

Marvellous

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:16:03+00:00Added an answer on May 25, 2026 at 12:16 pm

    In php.ini you need to have the following configuration:

    allow_url_fopen = On;
    allow_url_include = On;

    Be aware this makes you site vulnerable for XSS attacks and this isn’t recommended to use on production servers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been partially successful at removing almost all the popUp menus from the
We have been asked by a customer which encryption methods are used for our
We've just been our Coldfusion servers from Enterprise CF 8.01 to CF 9. They
We have some external APIs in our codebase that have been deprecated over the
We have been using Spring Remoting in our project for sometime. It is used
Have been trying to encrypt an xml file to a string so that I
Have been working on this question for a couple hours and have come close
Have been looking on some tutorials for drawing canvas using SurfaceView, but the only
Have been reading about async and tasks and been attempting to convert the CopyFileEx
Have been searching how to convert a dictionary to a string. But the results

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.