Clumps Posted May 16, 2007 Share Posted May 16, 2007 Hello all, Please forgive my inexperience. Hopefully this is an easy question. I think I need an XML parser but I'm not entirely sure. I have a PHP file with the following code... <param name="movie" value="photoviewer.swf?intGalleryID=<?php echo $_GET['GalleryID']; ?>&intPhotoID=<?php echo $_GET['PhotoID']; ?>"> <param name="quality" value="high"><param name="BGCOLOR" value="#000000"> <embed src="photoviewer.swf?intGalleryID=<?php echo $_GET['GalleryID']; ?>&intPhotoID=<?php echo $_GET['PhotoID']; ?>" width="560" height="560" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="#000000"></embed> The file passes arguments to "photoviewer.swf" which includes the following reference... ruXML.load(_root.strXMLURL + "/xml/gallery.xml?GalleryID=" + intGalleryID); to "gallery.xml". Gallery XML contains a tree structure as follows... <?xml version="1.0" encoding="UTF-8"?> <galleries> <gallery ID="12345" gname="Name"> </gallery> <gallery ID="22345" gname="Name"> </gallery> </galleries> Now, while the browser shows it's loading the correct XML Gallery ID it actually loads the entire XML file and only reads the first id before hitting the first </gallery> and aborting. In essence, while the browser states it's reading the correct ID it's certainly not displaying it. It only displays whichever gallery is first. Do I need a parser? Is there some code I can place in my PHP to possibly make this work? Any help is greatly appreciated. Thank You. "Clumps" Quote Link to comment https://forums.phpfreaks.com/topic/51615-php-xml-recognition/ Share on other sites More sharing options...
boo_lolly Posted May 16, 2007 Share Posted May 16, 2007 it looks like it's javascript that is parsing the xml document. check out this link: http://www.saxproject.org/ it may help. Quote Link to comment https://forums.phpfreaks.com/topic/51615-php-xml-recognition/#findComment-254275 Share on other sites More sharing options...
phast1 Posted May 16, 2007 Share Posted May 16, 2007 Your Flash file is responsible for parsing the XML file, and you are already using an XML parser with this line: ruXML.load(_root.strXMLURL + "/xml/gallery.xml?GalleryID=" + intGalleryID); Your PHP file is only responsible for generating the correct Flash file URL in the HTML code, which is definitely working if you see the variables being displayed at the top of your browser.. Like I mentioned in your other thread about this, you need to add some debugging code to your Flash file to verify that that the Flash file is receiving the intGalleryID variable correctly.. If it is, then you would probably want to find the documentation for the ruXML class that the Flash file uses to try and figure out why it isn't doing what you expect.. If you don't know what to do in the Flash code, then you might have better luck getting more help in a Flash forum, since most users on this forum are coding in PHP without Flash.. Quote Link to comment https://forums.phpfreaks.com/topic/51615-php-xml-recognition/#findComment-254276 Share on other sites More sharing options...
Chesso Posted May 16, 2007 Share Posted May 16, 2007 Yeah you'll be looking at using GetUrl and the XML file class (the name he uses is just a name for a class instance, not the actual class name). Quote Link to comment https://forums.phpfreaks.com/topic/51615-php-xml-recognition/#findComment-254278 Share on other sites More sharing options...
Clumps Posted May 16, 2007 Author Share Posted May 16, 2007 Ok. Well thanks again. I thought it might be that "GalleryID" might not refer to the ID tag of Gallery. Hence I thought it might be a matter of referring to the XML from PHP and naming conventions and such... I'll check a flash forum. Quote Link to comment https://forums.phpfreaks.com/topic/51615-php-xml-recognition/#findComment-254292 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.