Jump to content

PHP and XML


sean14592

Recommended Posts

Im, using a slideshow script and it uses this xml to fetch the images....

[code]
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<root>
<settings bordercolor="0xFF0000" delay="20" step="10" a="140"/>
<images>
	<img src="images/ws2-b1581-20040201181235-t.jpg" alt="www.frogstyle.ch" width="128" height="96" big_src="images/ws2-b1581-20040201181235-g.jpg" big_width="640" big_height="480"/>
	<img src="images/ws2-b1570-20040201180406-t.jpg" alt="www.frogstyle.ch" width="128" height="96" big_src="images/ws2-b1570-20040201180406-g.jpg" big_width="640" big_height="480"/>
	<img src="images/ws2-b1572-20040201180444-t.jpg" alt="www.frogstyle.ch" width="128" height="96" big_src="images/ws2-b1572-20040201180444-g.jpg" big_width="640" big_height="480"/>
</images>
</root>

 

 

 

 

Though I need the image to change to a var fetched from mysql, So that it looks like this.

 

<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<root>
<settings bordercolor="0xFF0000" delay="20" step="10" a="140"/>
<images>
	<img src="$siteurl."properties/owners".$row['username']."images/ws2-b1581-20040201181235-t.jpg" alt="www.frogstyle.ch" width="128" height="96" big_src="$siteurl."properties/owners".$row['username']."images/ws2-b1581-20040201181235-g.jpg" big_width="640" big_height="480"/>
	<img src="$siteurl."properties/owners".$row['username']."images/ws2-b1570-20040201180406-t.jpg" alt="www.frogstyle.ch" width="128" height="96" big_src="$siteurl."properties/owners".$row['username']."images/ws2-b1570-20040201180406-g.jpg" big_width="640" big_height="480"/>
	<img src="$siteurl."properties/owners".$row['username']."images/ws2-b1572-20040201180444-t.jpg" alt="www.frogstyle.ch" width="128" height="96" big_src="$siteurl."properties/owners".$row['username']."images/ws2-b1572-20040201180444-g.jpg" big_width="640" big_height="480"/>
</images>
</root>

 

So it includes variables, How can I do this or is there anythere way?

 

Cheers

Sean[/code]

Link to comment
https://forums.phpfreaks.com/topic/109261-php-and-xml/
Share on other sites

Or echo the whole thing...

 

<?php
echo '
<root>
<settings bordercolor="0xFF0000" delay="20" step="10" a="140"/>
<images>
	<img src="' . $siteurl . '"properties/owners"' . $row['username'] . '"images/ws2-b1581-20040201181235-t.jpg" alt="www.frogstyle.ch" width="128" height="96" big_src="' . $siteurl . '"properties/owners"' . $row['username'] . '"images/ws2-b1581-20040201181235-g.jpg" big_width="640" big_height="480"/>
	<img src="' . $siteurl . '"properties/owners"' . $row['username'] . '"images/ws2-b1570-20040201180406-t.jpg" alt="www.frogstyle.ch" width="128" height="96" big_src="' . $siteurl . '"properties/owners"' . $row['username'] . '"images/ws2-b1570-20040201180406-g.jpg" big_width="640" big_height="480"/>
	<img src="' . $siteurl . '"properties/owners"' . $row['username'] . '"images/ws2-b1572-20040201180444-t.jpg" alt="www.frogstyle.ch" width="128" height="96" big_src="' . $siteurl . '"properties/owners"' . $row['username'] . '"images/ws2-b1572-20040201180444-g.jpg" big_width="640" big_height="480"/>
</images>
</root>
';  
?>

Link to comment
https://forums.phpfreaks.com/topic/109261-php-and-xml/#findComment-560494
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.