jfreak53
01-24-2009, 03:02 PM
I have searched and searched and have read tutorials but I still don't get it. I have been trying to get a php script of mine to work with XML but I can't get it to work. I got it to parse the file correctly and give me a print out, but I can't figure out how to delete parts and append new parts. Here is the code I am using to parse it and display:
$xmlFileData = file_get_contents("gallery.xml");
$xmlData = new SimpleXMLElement($xmlFileData);
foreach($xmlData->image as $image) {
?>
<tr>
<td>Delete</td>
<td><? echo $image->filename ?></td>
<td><? echo $image->caption ?></td>
</tr>
This works just fine. What I need though is code for that delete button to delete a record at a time, and I need code so at the bottom of this page I can put a form for appending to this file. This code I cannot find no matter how long I search, it is getting nerve racking. :(
Thanks for any help you can give me.
$xmlFileData = file_get_contents("gallery.xml");
$xmlData = new SimpleXMLElement($xmlFileData);
foreach($xmlData->image as $image) {
?>
<tr>
<td>Delete</td>
<td><? echo $image->filename ?></td>
<td><? echo $image->caption ?></td>
</tr>
This works just fine. What I need though is code for that delete button to delete a record at a time, and I need code so at the bottom of this page I can put a form for appending to this file. This code I cannot find no matter how long I search, it is getting nerve racking. :(
Thanks for any help you can give me.