Im trying using these two different scripts to have a mediaplayer start playing the songs listed in the array.
When launching these php scripts from my webserver a window pops up asking me to open or save the file. When I open it I get the message, "Cannot
find the C:\Documents and Settings\computername\Local
Settings\Temporary Internet Files\Content.IE5\
BK3W3DD6\test[1].php file.
<?php
header("Content-type: video/x-ms-asf");
?>
<?
function get_random_url() {
$files = array('IMoK.mp3', 'By The Way.wma', 'Do U Want Me.mp3');
$index = rand(0, count($files)-1);
$random_url = "http://ryanismy.name/" . $files[$index];
return $random_url;
}
for ($i = 0; $i < 10; ++$i) {
$random_url = get_random_url();
echo '<ENTRY><REF HREF="' . $random_url . '"/></ENTRY>' . "\r\n";
}
?>
With the below code you graciously provided, the same thing happens yet
after Content.IE5********\ the asteriks represent
numbers that constantly change each time i accept open.
<?php
ob_start();
$asx = getASXString();
header("Content-type: video/x-ms-asf");
header("Content-length: ".strlen($asx));
ob_end_clean();
exit;
function get_random_url() {
$files = array('IMoK.mp3', 'By The Way.wma', 'Do U Want
Me.mp3');
$index = rand(0, count($files)-1);
$random_url = "http://ryanismy.name/" . $files[$index];
return $random_url;
}
function getASXString() {
$output = '<ASX version="3.0">';
for ($i = 0; $i < 10; ++$i) {
$random_url = get_random_url();
$output.="\r\n" . '<ENTRY><REF HREF="' . $random_url .
'"/></ENTRY>';
}
$output.="\r\n</ASX>";
return $output;
}
?>
Any ideas whats wrong with my code and where have I gone wrong? Do any of these scripts work for you? It could be my php server isnt is set up correctly?
Cheers, Chasre