I was wondering why I always get "failed to open stream: HTTP request failed!" error in either loading a normal or xml file. i don't understand why i can't get the whole result. the result i get is only some part of the respective url (the one i tried to load). The following is my php code to open the file:
[PHP]$file= fopen('http://localhost/V3JRoute?slot=1&startX=103.880764&startY=1.335458& endX=103.886297&endY=1.334953&routeType=1&format=2 ',"r");[/PHP]
This is the result i get from the code above (the underlined text is part of the result):
PHP Warning: fopen(http://localhost/V3JRoute?slot=1&startX=103.880764&startY=1.335458& endX=103.886297&endY=1.334953&routeType=1&format=2 ) [function.fopen]: failed to open stream: HTTP request failed! $5$14:04:41,14:04:41,14:04:41,14:04:41,14:04:41$0. 0,0.0,0.0,0.0,0.0$Depart on,Turn sharp left onto,Continue on,Turn right onto in C:\Program Files\MapGuideOpenSource\WebServerExtensions\www\p hpviewersample\xmlaccesstrial.php on line 12
While the following is my php code to load the xml page:
[PHP]$clients = simplexml_load_file('http://localhost/mapguide/phpviewersample/cobacoba.xml');
echo $clients->routeType; [/PHP]
The following is the result i get from the code above (the underlined text is part of the result):
PHP Warning: simplexml_load_file(http://localhost/V3JRoute?slot=1&startX=103.880764&startY=1.335458& endX=103.886297&endY=1.334953&routeType=1&format=1 ) [function.simplexml-load-file]: failed to open stream: HTTP request failed! <?xml version="1.0" ?> in C:\Program Files\MapGuideOpenSource\WebServerExtensions\www\p hpviewersample\xmlaccesstrial.php on line 2 PHP Warning: http://localhost/V3JRoute?slot=1&startX=103.880764&startY=1.335458& endX=103.886297&endY=1.334953&routeType=1&format=1 :1: parser error : Document is empty in C:\Program Files\MapGuideOpenSource\WebServerExtensions\www\p hpviewersample\xmlaccesstrial.php on line 2 PHP Warning: in C:\Program Files\MapGuideOpenSource\WebServerExtensions\www\p hpviewersample\xmlaccesstrial.php on line 2 PHP Warning: ^ in C:\Program Files\MapGuideOpenSource\WebServerExtensions\www\p hpviewersample\xmlaccesstrial.php on line 2 PHP Warning: http://localhost/V3JRoute?slot=1&startX=103.880764&startY=1.335458& endX=103.886297&endY=1.334953&routeType=1&format=1 :1: parser error : Start tag expected, '<' not found in C:\Program Files\MapGuideOpenSource\WebServerExtensions\www\p hpviewersample\xmlaccesstrial.php on line 2 PHP Warning: in C:\Program Files\MapGuideOpenSource\WebServerExtensions\www\p hpviewersample\xmlaccesstrial.php on line 2 PHP Warning: ^ in C:\Program Files\MapGuideOpenSource\WebServerExtensions\www\p hpviewersample\xmlaccesstrial.php on line 2 PHP Notice: Trying to get property of non-object in C:\Program Files\MapGuideOpenSource\WebServerExtensions\www\p hpviewersample\xmlaccesstrial.php on line 3I hope somebody can help me out from this issue.
Anyway, Merry Christmas....
Thank you
Regards,
Kencana