Hello,
I would like to write to an XML file from a HTML form. I am not having any luck doing it like you would a text file, I don't have PHP5, and am not really sure where to start on it.
Any ideas?
Here is what I have done:
if (!empty($_POST['submit'])) {
$name = trim($_POST['name']);
$date = trim($_POST['date']);
$bid = trim($_POST['bid']);
$fp=fopen("timber_sales.xml","wa");//append to the file
fwrite($fp,"<sale>" . "<name>". $name . "</name>" . "<date>" . $date . "</date>" . "<bid> ". $bid . "</bid>" . "</sale>" . "\n");
fclose($fp);
}
but that cannot be right. I looked into SimpleXML, but that is PHP5, DOM too... AHHH!
thanks!