Jump to content

pulling data from an xml file.


11Tami

Recommended Posts

Hi, I need to know how to pull data from an xml file with php.
For example, lets say I have a form field. When an xml file internet address is put into the form field and the "submit" button is pushed, I need to have just some of the xml fields appear on the page. Anyone have any basic code to get me started? I have no idea where this starts. I already know how to make forms I  just don't know how to pull the data to populate the form fields. Thank you very much.
Link to comment
Share on other sites

Saw you said nevermind but my post was already written so I'll still post it for people that search the forums for the same question...

To get the contents of a URL you can do [url=http://www.php.net/file_get_contents]file_get_contents()[/url] as for parsing the XML you might want to look into the [url=http://www.php.net/xml]XML[/url] and the [url=http://www.php.net/simplexml]Simple XML[/url] functions. There's also a [url=http://www.phpfreaks.com/tutorials/44/0.php]tutorial[/url] you could read (I'm sure it is wonderful, I just glanced at it).
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.