PDA

View Full Version : Can someone write a php script to write to a XML document in the following format



xearo
June 29th, 2006, 12:26 AM
Hi

i have a form that once filled in needs to update a XML document

can anyone out there write this for me ??

basically i have a news ticker that reads a XML document to get its information.

Now i need to be able to update the XML document via a HTML Form

the xml document is formatted in the following way

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>
<item>
<news>test this</news>
<url>www.google.com</url>
</item>
<item>
<news>News item 2</news>
<url>http://www.news item 2.com</url>
</item>
</images>

if anyone could help i would greatly appreciate it!
Cheers

AndyM103
July 2nd, 2006, 03:40 PM
I'm not going to write if for you but the standard way is this:
argh... deleted my good example:

ok...

<?php
header( "type: text/xml" );
print( "<xml [etc...]>" );

//Create the document here by just printing the relevant stuff

?>

This works for dynamically generated XML documents - if you want to save them just take down all the values and input them into a document - there's instructions on how to use the file functions on http://www.php.net - have fun!