i have an xml playlist on one of my sites: www.mollymalonesseafood.co.uk/play/playlist.xml Within that play list is a dynamic url (tho may not change as in test mode) beginning with 22.222.222 what i need is the URL 22.222.222 or what ever may replace it, to be placed in a page of my choice on page load. so... i have <div id="player"><embed pluginspace="WhackSlackPlugin.html" type="application/x-vlc-plugin" progid="VideoLAN.VLCPlugin.2" name="vlc" target="THIS IS BLANK" autoplay="true" autoloop="true" volume="25" width="900" height="500"></embed> </div> Code (markup): i need: <div id="player"><embed pluginspace="WhackSlackPlugin.html" type="application/x-vlc-plugin" progid="VideoLAN.VLCPlugin.2" name="vlc" target="the url from the xml goes here" autoplay="true" autoloop="true" volume="25" width="900" height="500"></embed> </div> Code (markup): simply: Take the url ://22.222.222 etc an put it in the player every time the page loads Please assist I nevere read the rules but i can and will give a few bucks if im allowed to
Try this script: $xml = simplexml_load_file("http://www.mollymalonesseafood.co.uk/play/playlist.xml"); $player = '<div id="player"><embed pluginspace="WhackSlackPlugin.html" type="application/x-vlc-plugin" progid="VideoLAN.VLCPlugin.2" name="vlc" target="%s" autoplay="true" autoloop="true" volume="25" width="900" height="500"></embed></div>'; printf($player,$xml->url); PHP:
I'm sure I posted this earlier but I can't find the thread. Anyway, here it is again: <html> <head> <script type="text/javascript"> function loadVideo() { var vidurl, xmldoc, xmlhttp; if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); // code for IE7+, Firefox, Chrome, Opera, Safari } else { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); // code for IE6, IE5 } xmlhttp.open("GET", "http://www.mollymalonesseafood.co.uk/play/playlist.xml", false); xmlhttp.send(); xmldoc = xmlhttp.responseXML; vidurl = xmldoc.getElementsByTagName("url")[0].childNodes[0].nodeValue; document.getElementById("player").childNodes[0].setAttribute("target", vidurl); } </script> </head> <body onload="loadVideo()"> <div id="player"><embed pluginspace="WhackSlackPlugin.html" type="application/x-vlc-plugin" progid="VideoLAN.VLCPlugin.2" name="vlc" target="" autoplay="true" autoloop="true" volume="25" width="900" height="500"></embed></div> </body> </html> Code (markup): Only works if the domains are the same because of the same domain policy used by browsers.
Do you mean this: $xml = simplexml_load_file("http://www.mollymalonesseafood.co.uk/play/playlist.xml"); echo($xml->url); PHP: