sean14592 Posted June 8, 2008 Share Posted June 8, 2008 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] Quote Link to comment Share on other sites More sharing options...
retro Posted June 8, 2008 Share Posted June 8, 2008 You need to tell it you're using PHP.... <?php echo("<img src=\"dir1/dir2/" . $row["username"] . "/images/image.jpg /\">"); ?> or <a href="dir1/dir2/<? echo($row["username"]); ?>/images/image.jpg" /> Quote Link to comment Share on other sites More sharing options...
webent Posted June 8, 2008 Share Posted June 8, 2008 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> '; ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.