well i was using one of the xml/flash slideshow.Well the slide show takes the image source and link as follows from a xml file called images.xml
Code:<?xml version="1.0" encoding="utf-8" standalone="yes"?> <images> <pic> <image>http://www.xyz.com/modelimage/image1.jpg</image> <link>http://www.xyz.com/modelimage/showmodel.php?id=1</link> </pic> <pic> <image>http://www.xyz.com/modelimage/image2.jpg</image> <link>http://www.xyz.com/modelimage/showmodel.php?id=2</link> </pic> <pic> <image>http://www.xyz.com/modelimage/image3.jpg</image> <link>http://www.xyz.com/modelimage/showmodel.php?id=3</link> </pic> </images>
now what i want is to display the latest 3 images from my modelimage folder(the files are uploaded through php and filename is added to database and file is transferred to folder)
googling and going through some tutorials...
i came up with this..
note:i used google got one tutorial and edited it so it may conatin some parse error...help to remove it would be greatPHP Code:<?php
header("Content-type: text/xml");
$host = "localhost";
$user = "root";
$pass = "";
$database = "dbname";
$linkID = mysql_connect($host, $user, $pass) or die("Could not connect to host.");
mysql_select_db($database, $linkID) or die("Could not find database.");
$query = "SELECT photo_id,image FROM model_photo ORDER BY postedon DESC limit 3";
$resultID = mysql_query($query, $linkID) or die("Data not found.");
$xml_output = "<?xml version=\"1.0\"?>\n";
$xml_output .= "<images>\n";
for($x = 0 ; $x < mysql_num_rows($resultID) ; $x++){
$row = mysql_fetch_assoc($resultID);
$xml_output .= "\t<pic>\n";
$xml_output .= "\t\t<image>\"http://www.xyz.com/modelimage/{$row['photo_id']}\"</image>\n";
$xml_output .= "\t\t<link> \"http://www.xyz.com/modelimage/showmodel.php?id= {$row['photo_id']}\"</link>\n";//have doubt in this line
$xml_output .= "\t</pic>\n";
}
$xml_output .= "</images>";
echo $xml_output;
?>
it should be saved as images.php (not xml) but the flash file has the hardcoded images.xml filename(xml file) in actionscript (fla file)...
so how can i get it work with out using any external plugin or mod rewrite(there can be other real xml files)...
any idea...?
here ...the file should be xml but it should contain php which retrives data from mysql to show images
any help
so how can i het it work...
(or i should use only use xml file(with out php) to get data from mysql..if that is the way any help how it can be done)








Bookmarks