The end result of my project is to have PHP create an xml file that Flash can use.
My Flash can read the XML file I wrote but the one that PHP creates I get nothing. The thing I guessing right now is that my PHP created XML is leaving a blank space at the very top, first line of the XML.
I am trying 2 examples one-PHP spitting out XML and another using the fopen method. Both are leaving a blank space at the top.
Here are my test results:
http://www.myborzu.com/test/index.php
http://www.myborzu.com/test/main.xml
And my code:
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM xmas";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
$i=0;
while ($i < $num) {
$name=mysql_result($result,$i,"name");
$pic1=mysql_result($result,$i,"pic1");
$desc1=mysql_result($result,$i,"desc1");
$pic2=mysql_result($result,$i,"pic2");
$desc2=mysql_result($result,$i,"desc2");
$pic3=mysql_result($result,$i,"pic3");
$desc3=mysql_result($result,$i,"desc3");
$pic4=mysql_result($result,$i,"pic4");
$desc4=mysql_result($result,$i,"desc4");
++$i;
}
echo "<slideshow>\n<photo url=\"lost1.jpg\" caption=\"Bob tries to explain to electronics theory to Kate.\" />\n
<photo url=\"lost2.jpg\" caption=\"Bob tries to explain to electronics theory to Kate.\" />\n
<photo url=\"lost3.jpg\" caption=\"bob tries to explain to electronics theory to Kate.\" />\n
<photo url=\"lost4.jpg\" caption=\"bob tries to explain to electronics theory to Kate.\" />\n
<photo url=\"lost5.jpg\" caption=\"bob tries to explain to electronics theory to Kate.\" />\n</slideshow>";
?>
Excuse the PHP code, first I want to make sure the XML to works before I dig into database stuff.
Thx for any help you can give me....
Nevermind I insert a blank space in the handtyped XML and flash read it fine....so it must be how I have my flash coded that causing the problem