importing xml help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
generic88
Forum Newbie
Posts: 3
Joined: Tue Aug 24, 2010 10:23 am

importing xml help

Post by generic88 »

Hi,

This may seem like a stupid question, but I'm quite new to php.

http://demo.gallerycms.com/index.php/view
Is it possible to import a string of xml from this url into php?

I've tried using simplexml, include, etc to import it, but with no luck

Thanks
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: importing xml help

Post by AbraCadaver »

Depends upon what you mean by import. What do you want to do with it?
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
generic88
Forum Newbie
Posts: 3
Joined: Tue Aug 24, 2010 10:23 am

Re: importing xml help

Post by generic88 »

Hi AbraCadaver,
sorry, I wasnt very clear there.

At this point I just want to drop the full stream of xml into a page of html, keeping all formatting etc. I'm just not sure what to do with the way it ends in /index.php/view rather than just being a .xml file.

Thanks
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: importing xml help

Post by AbraCadaver »

It doesn't matter what the path is, you can't display an XML file inside of an HTML page and have it appear as it does in the browser because you've already defined the page as HTML not XML. You can load the XML file and loop through it with PHP and display it how you want. Try http://us3.php.net/manual/en/simplexml. ... -basic.php
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
generic88
Forum Newbie
Posts: 3
Joined: Tue Aug 24, 2010 10:23 am

Re: importing xml help

Post by generic88 »

Hi Abra,

Thanks a million, I thought the problem was with the path but now I've a better understanding of what I'm doing wrong.
Post Reply