noxiousfix Posted March 2, 2009 Share Posted March 2, 2009 i'm trying to to use php to output xml populated from mysql. i have it working no prob. what i'm trying to do is get a swf. mp3 player to recognize the xml in the php for it's playlist. how do i do this? the <embed src> calls for an xml file. how do i get the player to see the php and make it think it is an xml file? any help would be greatly appreciated. thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/147555-mysql-php-and-xml/ Share on other sites More sharing options...
Mchl Posted March 2, 2009 Share Posted March 2, 2009 Set the proper headers in your php file. The player should work fine if you just point it to .php file, but if it needs a file with .xml entension, you might use mod_rewrite for that. Quote Link to comment https://forums.phpfreaks.com/topic/147555-mysql-php-and-xml/#findComment-774599 Share on other sites More sharing options...
noxiousfix Posted March 2, 2009 Author Share Posted March 2, 2009 i dont know if i can use a mod-rewrite. i'm not using apache server. i'm using abyss web server and it doesn't have that function. i don't think it'll work without it either. i have the appropiate header and all info intact but the player just says "loading playlist" but never loads... Quote Link to comment https://forums.phpfreaks.com/topic/147555-mysql-php-and-xml/#findComment-774620 Share on other sites More sharing options...
Mchl Posted March 2, 2009 Share Posted March 2, 2009 Try to save an output of your php file as plain xml file. See if player loads that. If not, then perhaps your XML is not valid. Quote Link to comment https://forums.phpfreaks.com/topic/147555-mysql-php-and-xml/#findComment-774630 Share on other sites More sharing options...
noxiousfix Posted March 2, 2009 Author Share Posted March 2, 2009 i'm not exactly sure how to do that. i'm kinda new when it comes to all this. i've only recently (past 2 months) gotten into php and mysql. Quote Link to comment https://forums.phpfreaks.com/topic/147555-mysql-php-and-xml/#findComment-774637 Share on other sites More sharing options...
Mchl Posted March 2, 2009 Share Posted March 2, 2009 Point your browser to your php file. Then use Save as... to save the output as 'playlist.xml' or whatever. Then put this file where your swf player expects it to be. Quote Link to comment https://forums.phpfreaks.com/topic/147555-mysql-php-and-xml/#findComment-774700 Share on other sites More sharing options...
noxiousfix Posted March 2, 2009 Author Share Posted March 2, 2009 (slaps forehead) hadn't thought of that. slick idea. ok, so i saved as .xml and guess what? the xml file works perfectly sitting right next to the .php file that should be. i'm really lost now. how can i get this to work? i have no idea what's wrong. thanks for the help though. i'm kinda slow at somethings...... Quote Link to comment https://forums.phpfreaks.com/topic/147555-mysql-php-and-xml/#findComment-774749 Share on other sites More sharing options...
Mchl Posted March 2, 2009 Share Posted March 2, 2009 Perhaps you should consult your webserver's documentation to see if it has similar functionality to Apache's mod_rewrite. Quote Link to comment https://forums.phpfreaks.com/topic/147555-mysql-php-and-xml/#findComment-774761 Share on other sites More sharing options...
noxiousfix Posted March 2, 2009 Author Share Posted March 2, 2009 i have and it doesn't. i went to their forums and the only thing i found were hacks. i might abbandon this idea altogether. i just cant get it to work. but get this: i tried another swf player that had an xml file. the xml set the parameters for bgcolor, width, blah and blah. not to mention the playlist. i was able to change the parameters of the swf file thru xml output but it wouldn't play the mp3. i litterally tried everything. every other parameter was able to be manipulated in some way. color, height, width, font, everything... all except for the mp3. i read in another forum about UTF-8 ecoding. what does that mean? it said something about the xml being UTF-8 encoded and sometimes the data from the mysql query isn't and it could cause problems. so i checked mysql table columns and all are set to UTF-8_general_ci. do you think it would be a problem with how the database is sending the information? php can read and process it but flash won't because of encoding? hey, thanks for all the help too btw. this is my day off so i'll be in and out of here all day more than likely checkin on this until i just give up and go on to something else. thing is, i don't want to give up just yet. welp, off to search other forums for the magic wand that brings this script to life... Quote Link to comment https://forums.phpfreaks.com/topic/147555-mysql-php-and-xml/#findComment-774824 Share on other sites More sharing options...
Mchl Posted March 2, 2009 Share Posted March 2, 2009 After connecting to mysql do mysql_query("SET NAMES 'utf8'"); this will set the encoding for mysql connection (often forgot). Also use headers to declare encoding for output file. Here's some reading http://en.wikipedia.org/wiki/List_of_HTTP_headers Quote Link to comment https://forums.phpfreaks.com/topic/147555-mysql-php-and-xml/#findComment-774849 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.