flemingmike Posted June 8, 2010 Share Posted June 8, 2010 hello, i was going through a tutorial on how to display xml data on a website. here is my xml output from my music player: <?xml version="1.0" encoding="UTF-8" ?> - <hmm status="ok"> - <tracks> - <track> <album>Sixteen Stone</album> <bpm>0</bpm> <database-id>4</database-id> <exists>false</exists> <filename>D:\Temp\Music\h07 - Machinehead.mp3</filename> <index>0</index> <length>256</length> <mood /> <popularity>0</popularity> <recording-year>1994</recording-year> <release-year>1994</release-year> <situation /> <publisher /> <format>MPEG Audio 128 kbps</format> <is-subtrack>false</is-subtrack> <is-favourite>false</is-favourite> <release-type>0</release-type> <subtrack-index>-1</subtrack-index> <artist>Bush</artist> <genre>Rock</genre> <rating>0</rating> <title>Machinehead</title> </track> </tracks> </hmm> here is the code that i thought would display the artists name: <xml ID="music" src="http://localhost:8181/1.0/?method=player.getNowPlayingData"></xml> Artist: <span datasrc="music" datafld="artist"></span> should this work? Link to comment https://forums.phpfreaks.com/topic/204234-should-this-work-or-am-i-stupid/ Share on other sites More sharing options...
sspoke Posted June 8, 2010 Share Posted June 8, 2010 your problem is being stupid lol joking http://localhost:8181/1.0/?met localhost is your local computer ip.. for me localhost shows my website.. running on my computer u gotta use a real ip address or your domain name Link to comment https://forums.phpfreaks.com/topic/204234-should-this-work-or-am-i-stupid/#findComment-1069717 Share on other sites More sharing options...
andrewgauger Posted June 8, 2010 Share Posted June 8, 2010 Good song. I am willing to bet that the media player isn't attached to a publicly facing server. I'd bet you are using localhost for this. Throw http://localhost:8181/1.0/?method=player.getNowPlayingData into your browser window to make sure you get the xml out. Then fix your problem and replace: <span datasrc="music" datafld="artist"></span> with: <span datasrc="#music" datafld="artist"></span> Link to comment https://forums.phpfreaks.com/topic/204234-should-this-work-or-am-i-stupid/#findComment-1069719 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.