Forum Moderators: coopster

Message Too Old, No Replies

PHP and XML for image galleries question.

         

Kombak

3:18 pm on Jul 20, 2010 (gmt 0)

10+ Year Member



Hi,

I am very new to PHP. I am making a site for an artist friend of mine and I want to create image galleries based on the XML file that is loaded.

I can't seem to get PHP to load the XML file or do any variable replacement on the tags I am using.

here is a sample XML file:

<?xml version="1.0" encoding="utf-8" ?>
<images>
<image>
<thumb>thumbnails/6-41amafter_tiff.jpg</thumb>
<src>images/The Stillness Between/6_41am_after.JPG</src>
<title>6:41 a.m. After</title>
<alt>641AMafter</alt>
<w>110</w>
<h>90</h>
<gal>gallery[thestillnessbetween]</gal>
<divclass>6:41 a.m. After.</divclass>
</image>
</images>


and here is an example of the output I want:


<div class="img">
<a href="images/6_41am_after.JPG" class="lightview" rel="gallery[thestillnessbetween]" title="6:41A.M. After">
<img src="images/small/6_41am_after110x90.JPG" alt="641AMafter" width="110" height="90" />
</a>
<div class="desc">6:41 A.M. After.</div>
</div>


any help would be greatly appreciated.

thanks,

Kombak

3:27 pm on Jul 20, 2010 (gmt 0)

10+ Year Member



Never Mind. I figured it out. I am an idiot. :P

I forgot to change the extension of the page to PHP.

Then I Used: getElementByTagName when it should have been getElementsByTagName.

::face palm::

rocknbil

4:57 pm on Jul 20, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome aboard KomBak, sometimes you need to see it typed out . . . to see it. :-)