0

this is my xml file its using in flash image viewer

<?xml version="1.0" encoding="UTF-8"?>

<gallery>
<image url="Flower Photo 1.jpg" />
<image url="Flower Photo 2.jpg" />
<image url="Flower Photo 3.jpg" />
<image url="Flower Photo 4.jpg" />
<image url="Flower Photo 5.jpg" />
<image url="Flower Photo 6.jpg" />
<image url="Flower Photo 7.jpg" />
<image url="Flower Photo 8.jpg" />
<image url="Flower Photo 9.jpg" />
<image url="Flower Photo 10.jpg" />
</gallery>

what i want is add new image tag using php form

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by ruwanaru
0

Try following these steps:

1. Read the XML file content into a PHP array.
There are many ways of doing this. I'd recommend the use of a couple of simple functions for converting between XML data and PHP arrays. (Google "php array to xml")

2. Add the new image to the array.
Then sort the array (if order is of any concern).

3. Convert the array back into XML and write that out to the XML file.
(Use the function/s from #1)

Hope that helps.

-Dave

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.