note 27006 deleted from function.header by sniper
| From: | sniper@php.net | Date: | Sun, 07 Sep 2003 21:36:54 +0000 |
| Subject: | note 27006 deleted from function.header by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-55628@lists.php.net to get a copy of this message | ||
Note Submitter: adon@theDV8network.com
----
here's a rework of a previous example ..
i'm switching from shoutcast to icecast2 , and from .mp3 to .ogg formats .. but my radio
station has about 3 months of .mp3 archives .
here's a script to create a .pls file that will stream either .mp3 OR .ogg , AND will
auto-download and (hopefully ) load winamp .
( check us out http://theDV8network.com _ free Radio and
fertile resistances, fresh from the Canadian underground ) .
a:/,
____
<?php
if( isset($HTTP_GET_VARS['showcode']) ) $showcode = $HTTP_GET_VARS['showcode'];
if( isset($HTTP_GET_VARS['episode']) ) $episode = $HTTP_GET_VARS['episode'];
if( isset($HTTP_GET_VARS['quality']) ) $quality = $HTTP_GET_VARS['quality'];
if( isset($HTTP_GET_VARS['format']) ) $format = $HTTP_GET_VARS['format'];
$mountpoint="http://theDV8network.com:8004/dv8_shows/
{$showcode}/{$showcode}-{$episode}_{$quality}.
{$format}";
$attachment = (strstr($HTTP_USER_AGENT, "MSIE")) ? "" : " attachment";
// IE 5.5 fix.
$string = "[playlist]
File1={$mountpoint}
NumberOfEntries=1";
header("Cache-control: private"); // another fix for IE
header("Content-Type: application/pls");
header("Content-Length: ".strlen($string));
header("Content-Disposition: attachment; filename=theDV8network."."pls");
echo $string;
?>
___