Hello there

I am trying to get a simple guestbook working with flash (front-end) and php/xml (back-end).

First i got a simple php-script that writes data to guest.db file and the data looks like:
barry||barry%40fula.nl||Aug%2024||2001||19%3A58||Hi%20there

The php-script i use looks like this:
<?PHP
if ($command=="view"){
$info=file("guest.db");
$max=sizeof($info);
for ($i=0;$i<$max;++$i){
$temp=explode("||",$info[$i]);
echo("&name".($i+1)."=".$temp[0].
"&email".($i+1)."=".$temp[1].
"&date".($i+1)."=".$temp[2].
"&year".($i+1)."=".$temp[3].
"&time".($i+1)."=".$temp[4].
"&message".($i+1)."=".$temp[5]);
}
echo("&max=".$max);
}
if ($command=="sign"){
if ($name!="" && $message!=""){
$fp=fopen("guest.db","a");
fputs($fp, rawurlencode(StripSlashes($name))."||".
rawurlencode(StripSlashes($email))."||".
rawurlencode(date("M d"))."||".
rawurlencode(date("Y"))."||".
rawurlencode(date("H:i"))."||".
rawurlencode(StripSlashes($message))."\n");
fclose($fp);
}
echo("done=1");
}
?>


Now i want to replace the guest.db with guest.xml. My xml doc has the following structure:

<?xml version="1.0" standalone="yes" ?>
<Guestbook>
<Message Name="" Email="" Date="" Time="" Words=""/>
</Guestbook>

I think i must replace the guest.db file in the php-script with guest.xml, right?
But how do i rewrite the php-script so that it has the xml doc as output??

Long story i know,
Greetz
D-flyer