SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot busylinks1's Avatar
    Join Date
    Nov 2008
    Posts
    160
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How can I access data from remote XML file

    Hi,
    Can any one tell me,
    How can I access data from remote XML file
    and print in the my page...

    I am new to webservices so please tell me in detail...
    I am using php.........

    Thanks

  2. #2
    SitePoint Addict fattyjules's Avatar
    Join Date
    Dec 2005
    Posts
    295
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This works, I've just tested it.

    Code:
    $url = 'http://feeds.theage.com.au/rssheadlines/top.xml';
    $xml = file_get_contents($url,'r');
    echo $xml;

    Very simple, but you get the idea.

  3. #3
    SitePoint Zealot busylinks1's Avatar
    Join Date
    Nov 2008
    Posts
    160
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    with this it print all the data as it is ...

    How can we arrahge it like if we have to show it in different tables...

  4. #4
    Use The Cloud
    Join Date
    Jan 2006
    Location
    Boise, ID
    Posts
    556
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://www.php.net/simplexml

    Has everything you need.

    PHP Code:
    $xml simplexml_load_file(URL);
    print_r($xml); 
    Brad Hanson, Web Applications & Scalability Specialist
    ► Is your website outgrowing its current hosting solution?
    ► PM me for a FREE scalability consult!
    ► USA Based: Available by Phone, Skype, AIM, and E-mail.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •