I'm going to try to explain this, Hope you can follow.
I have a 'Flash Player' that connects using remote links including 'Remote Config File' which uses XML as the configuration.
Flash Player works on directly, .XML files.
Example: name.xml
Then I tested and created a config.php to include the XML File.
<?php
$var = $_GET['var'];
if(file_exists("config/$var.xml")) {
include("config/$var.xml");
} else {
echo "Sorry, $var not found.";
}
?>
Updated the remote code, to connect to the config.php?var=NAME
Works Successfully.
Now, I'm trying to move away from the XML File and use a MySQL Database to 'Read' the 'NEW config.php?var=NAME' and shows fine from the database.
When connecting, to the 'Flash Player' it does NOT want to read it and I'm wondering if it has something to do with the way XML is being outputted, but I've attempted almost everything.
This is for a Live Flash Streaming Player (Live Radio Stations)
Example: Database Driven XML
<?php
include("db.php");
$connect = mysql_connect($db["hostname"], $db["username"], $db["password"]) or die ("Could not connect to MySQL");
mysql_select_db ($db["database"]) or die ("Could not select database");
$radio = $_GET['radio'];
$config["query"] = "SELECT * FROM config WHERE name='$radio'";
$config["result"] = mysql_query ($config["query"]) or die ("Config Query Failed");
$config = mysql_fetch_object($config["result"]);
$stream["query"] = "SELECT config.gid, stream.gid, stream.host, stream.port, stream.name, stream.genre FROM config, stream WHERE stream.gid = config.gid";
$stream["result"] = mysql_query ($stream["query"]) or die ("Stream Query Failed");
header('Content-Type: text/xml');
?>
<config>
<!-- true / false -->
<auto_start><?php echo $config->auto_start; ?></auto_start>
<player_skin><?php echo $config->player_skin; ?></player_skin>
<main_title><?php echo $config->main_title; ?></main_title>
<playlist_title>PLAYLIST</playlist_title>
<time_text>TOTAL TIME</time_text>
<pan_labels>L,R</pan_labels>
<!-- possible options: GENRE, IP (show in second column in playlist) -->
<playlist_show>GENRE</playlist_show>
<genre_title>Genre</genre_title>
<station_title>Station</station_title>
<quality_title>Quality</quality_title>
<!-- for example: best quality = *****, worst quality = * -->
<quality_icon>*</quality_icon>
<!-- must be an integer 1 - 20 -->
<scroller_speed><?php echo $config->scroller_speed; ?></scroller_speed>
<!-- possible options: #CURRENT_SONG#, #STATION_URL#, #STATION_NAME#, #GENRE#, #CURRENT_ARTIST# -->
<scroller_marquee_content><?php echo $config->scroller_marquee_content; ?></scroller_marquee_content>
<!--Shuffle button enabled-->
<!-- true / false -->
<shuffle_is_enabled><?php echo $config->shuffle_is_enabled; ?></shuffle_is_enabled>
<!-- must be an integer 0 .. 100 -->
<default_volume><?php echo $config->default_volume; ?></default_volume>
<!-- must be an integer -100 .. 100 -->
<default_pan>0</default_pan>
<!-- Message, if player couldn't load music-->
<music_error_message><?php echo $config->music_error_message; ?></music_error_message>
<!-- Timeout to get radio station quality -->
<quality_timeout><?php echo $config->quality_timeout; ?></quality_timeout>
<!-- Timeout to get music name -->
<musicname_timeout><?php echo $config->musicname_timeout; ?></musicname_timeout>
<?php
while ($streams = mysql_fetch_array($stream["result"])) {
print "<station url=\"".$streams["host"].":".$streams["port"]."\">
<name>".$streams["name"]."</name>
<genre>".$streams["genre"]."</genre>
</station>";
}
?>
</config>
Live Example: http://universalstorm.com/RADIO_FLASH/config.php?radio=UniversalStorm
Remote Working Example: http://www.djdog2006.com/stream.html
Remote Non Working Example: http://www.djdog2006.com/stream.php
Maybe someone can help me out.