Jump to content

trying to open a xml file


justcreations

Recommended Posts

Hi people,

 

I'm trying to use simpleXML in php.

 

But struck a problem with the way my XML is generated. In a browser the URL below will generate the XML appropiately, but in php i cant get the asp generated xml content. Ive just stated with php, so my noob debuging abilities leads me to think that because the URL is compounded with parameters for the asp to generate the xml, functions like fopen() or file_get_contents() dont give me the generated XML content.

 

http://rtt.metroinfo.org.nz/RTT/Public/Utility/File.aspx?Name=RoutePositionET.xml&ContentType=SQLXML&PlatformNo=38719

 

I will really appreciate some advice, even if some can tell me what a compounded URL like the one above is called.

 

Thanks

Link to comment
Share on other sites

Try this

 

<?php
$s = simplexml_load_file('http://rtt.metroinfo.org.nz/RTT/Public/Utility/File.aspx?Name=RoutePositionET.xml&ContentType=SQLXML&PlatformNo=38719');

foreach($s->row as $email ){
echo $email."<br>";
}
print_r($s);
?>

 

Regards

Sharad.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.