Forum Moderators: coopster
ex.
<embed in media player>
mp3.oldserver.com/demo - demo.mp3
and change it into
www.newserver.com/stream.php?id=demo - demo
something like that and unable tobe download by the users. I've tried surfing the net and i could find one. tnx 4 helping me.
[edited by: jatar_k at 6:54 pm (utc) on Nov. 21, 2006]
[edit reason] Removed e-mail link as per TOS. [/edit]
<EMBED type='application/x-mplayer2' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'
id='mediaPlayer'
name='mediaPlayer'
showcontrols="true"
width="320" height="285"
src="http://www.oldserver.com/mp3/songtest.mp3"
autostart="true"</EMBED>
This is the player code with a mp3 file located at my old server "http://www.oldserver.com/mp3/songtest.mp3" and i want to change it "http://www.newserver.com/songplayer?id=songtest" making it a dynamic link using php and would became like this.
<EMBED type='application/x-mplayer2' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'
id='mediaPlayer'
name='mediaPlayer'
showcontrols="true"
width="320" height="285"
src="http://www.newserver.com/songplayer?id=songtest"
autostart="true"</EMBED>
Any idea? thanks for your reply.
You could try to use Rewrite Mod, information in Apache forum [webmasterworld.com].
php code
//specify folder of the mp3 files
// this is not necessary you can query the complete path from database
$mp3dir = "http://localhost/playground/";
//here I called my db class
include 'db/mysql_db.php';
$id=$_GET['id']; // id of specific entry
//creating db object and querying from database;
$db = new sql();
$row = $db->sql_query("select path from lyrics where id=\"$id\"");
$res = $db->sql_fetchrow($row);
$mp3file = $res[0]['path'];
$filename = $mp3dir.$mp3file;
//echo $filename;
header("Content-Type: audio/mp3");
readfile($filename);
HTML part
<EMBED type='application/x-mplayer2' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'
id='mediaPlayer'
name='mediaPlayer'
showcontrols="true"
width="320" height="285"
src="http://localhost/playground/test1.php?id=60"
autostart="true"</EMBED>