VB icon

a simple way to stream mp3 files without mod_mp3

Email
Submitted on: 1/1/2015 6:23:00 AM
By: Digital (from psc cd)  
Level: Advanced
User Rating: By 7 Users
Compatibility: PHP 3.0, PHP 4.0
Views: 2298
 
     This code makes it possible for you to stream any mp3 file on the internet. It does NOT need mod_mp3. It's complete, and ready to go.
 
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
//**************************************
// for :a simple way to stream mp3 files without mod_mp3
//**************************************
Copyright 2001 - The DE-Network -- Dan Graaff
http://www.de-net.org
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
//**************************************
// Name: a simple way to stream mp3 files without mod_mp3
// Description:This code makes it possible for you to stream any mp3 file on the internet. It does NOT need mod_mp3. It's complete, and ready to go.
// By: Digital (from psc cd)
//
// Inputs:$loc == the location of the mp3 file
$Play == "yes" to play the file, or not defined to just prompt
//
// Returns:the sweet nectar of streaming mp3 music
//
// Assumes:this is stupid easy to use.
//
// Side Effects:internal bleeding, spontanious combustion, uncontrolable vomitting
//**************************************

<?
// This Program was written by Digital -- digital@de-net.org
// Any copying without my concent will get you killed by cuban snipers.
// http://www.de-net.org
if (!$Play)
{
?>
<html>
<head>
<title>DE-Network Mp3 Streamer</title>
<style TYPE="text/css">
A:link
{
COLOR: #00007D;
TEXT-DECORATION: none
}
A:visited
{
TEXT-DECORATION: none
}
A:active
{
TEXT-DECORATION: none
}
A:hover
{
COLOR: #D90000
}
</style>
</head>
<body topmargin="0" leftmargin="0" bgcolor="#000000" text="#FFFFFF">
<div align="left">
 <table border="0" width="100%" height="100%" cellspacing="0" cellpadding="0" bordercolor="#FFFFFF" bgcolor="#000000">
<tr>
 <td width="100%" height="50%" valign="bottom">
<p align="center"><img border="0" src="http://www.de-net.org/insomnia/images/de-network.gif" width="589" height="202"></td>
</tr>
<tr>
 <td width="100%" height="48%" valign="top">
 <b>
<form action=<? echo $PHP_SELF; ?> method=POST>
<p align="center">
<font face="Verdana,Arial" size="3" color="#C0C0C0">
Enter the URL of an mp3 file:<br><input type="text" value="<? echo $loc; ?>" name="loc">
<input type="submit" value="Play" name="Play">
<br><br><font size=2>
To use this script seemlessly in your website, pass variables to this script like this:</b><br>
<a href="<i>http://www.de-net.org/audio/?<b>loc</b>=http://wherever.the/mp3/file.is&<b>Play</b>=yes</i>"><br>Click Here to listen to that one song!</a>
</font>
</form>
 
 </td>
</tr>
<tr>
 <td width="100%" height="2%" valign="top">
 <p align="center"><b><font face="Verdana,Arial" size="3" color="#808080">Powered
 by <a href="http://www.de-net.org"> The DE-Network</a> | Tool by <a href="http://www.de-net.org/bios?digital"> Digital</a></font></b>
 
 </td>
</tr>
 </table>
</div>
</body>
</html>
<?
}
else
{
if (!$loc)
{
 echo "There's no audio file specified...";
 die;
}
$loc = str_replace(" ", "%20",$loc);
Header("Content-Type: audio/x-mpegurl");
echo $loc . "\n"; }
?>


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

11/2/2017 6:33:11 AMwisdom

good
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.