note 35494 added to function.header
| From: | gohar dot 2 at osu dot edu | Date: | Wed, 03 Sep 2003 04:10:29 +0000 |
| Subject: | note 35494 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-55506@lists.php.net to get a copy of this message | ||
I found out a poor workaround for the Mozilla-appending-.php issue (which is really just the browser
reading the filename of the script that sends the stream). This may also explain why it works for
some people, and not others...
For starters, here's the code I'm working from...
<?php
$m3u_header = "audio/m3u";
$ogg_header = "application/ogg";
$mp3_header = "audio/mpeg";
$url = "http://hidayahonline.org/audio/Quraan/Mishaari%20Raashid/001.ogg";
header("Content-type: $m3u_header");
ob_start();
echo "#EXTM3U\n";
echo "#EXTINF:-1,\n";
echo "$url";
ob_flush();
?>
Technically, this matches the examples we have with the function description of header()...
What was happening was that my generated m3u list (that's what that code is SUPPOSED to do) was
being opened in Wordpad...which happens to be my "default" PHP editor...
I then changed Mozilla's "Helper Application" entry for the MIME type
"audio/m3u" to have an extension of "m3u"...and there is goes, opening in Winamp
(what I had wanted all along).
So, in other words, everyone I want this to work for has to do the same thing...and that may explain
why it was working for some people and not for others, which is what I gathered from the other
comments.
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35494
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35494&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35494&report=yes