Hello Guys i know that you all are really helpful thanks for that .
I am using this script
//**************************************
//
// Name: MP3 Archiver
// Description:This script will grab all
// the mp3's in a folder, get the Tags from
// them, ie.Title, Author, Album, Copyright
// , Comments, and will list them all on a
// page, in tables. Also it shows how to up
// load mp3's using a browser, and add them
// to that folder, which will then automati
// cally add it to your list.
// By: Steve Oliver
//
// Inputs:You must input 3 variables.
$destination
$directory
$url
//
// Side Effects:No side effects found as
// of yet.
//
//This code is copyrighted and has // limited warranties.Please see http://
// www.Planet-Source-Code.com/vb/scripts/Sh
// owCode.asp?txtCodeId=249&lngWId=8 //for details. //**************************************
//
<?PHP
function SubmitSong($filename,$filename_name){
#Desination path that mp3s will be uploaded to.
$destination="/path/to/mp3/folder/";
if (ereg(".mp3",$filename_name)){
copy($filename,$destination.$filename_name);
echo "<h1>File Uploaded...</h1>";
echo "<b>$filename_name was uploaded succesfully.</b><br><br>";
echo "<a href=\"mp3.php\">Click here to go back.</a>";
}else{die("<h1>Not a Valid mp3 file...</h1>"); }
}
function main(){
###################################################################
#URL to directory containing your mp3s
$url="http://www.yoursite.com/mp3s/";
#actual location of your mp3 folder
$directory="path/to/mp3/folder/";
###################################################################
$count=0;
$handle=opendir($directory);
while (($filename = readdir($handle))!==false) {
if ($filename != "." && $filename != ".." && ereg(".mp3",$filename)) {
$count++;
echo "<b>Song Number: $count</b>";
getTag($filename,$directory,$url);}
}
closedir($handle);
####################################################################
#This part adds a submit form to allow people to upload mp3s to you.
#If they are on a slow connection the script will time out unless
#you change the timeout rate of your script.
?>
<form method="post" action="mp3.php" enctype="multipart/form-data">
Submit MP3:
<input type="file" name="filename" size="20" tabindex="5">
<input type="hidden" name="action" value="SubmitSong">
<input type="submit" value="Submit" tabindex="8">
</form><?
}
####################################################################
function getTag($filename,$directory,$url){
$filetitle=$filename;
$filename= $directory.$filename;
$fp=fopen($filename,"r");
fseek($fp,filesize($filename)-128);
$checktag=fread($fp,3);
echo "<table width='100%' border='1' bgcolor='#c0c0c0'><tr><td>";
echo "<b><a href=\"$url$filetitle\">$filetitle</a></b><br></tr></td><tr><tr><tr bgcolor='#FFFFFF'><td>";
if ($checktag=="TAG") {
echo "Size: ".number_format(filesize($filename)/1000,2)." KBytes<br>";
echo "Title: ".fread($fp,30)."<br>";
echo "Author: ".fread($fp,30)."<br>";
echo "Album: ".fread($fp,30)."<br>";
echo "Copyright: ".fread($fp,4)."<br>";
echo "Comments: ".fread($fp,30)."<br>";
echo "</td></tr></table><br>";
}else{
echo "Size: ".filesize($filename)." Bytes<br>";
echo "<font color=\"red\"><b>No Tag</b></font><br>";
echo "</td></tr></table><br>";
fclose($filename);}
}
switch ($action){
default:
main();
break;
case "SubmitSong":
if ($filename=="none") {echo("<h1>No File Selected....</h1>"); break;}
submitsong($filename,$filename_name);
break;
}
?>
Its working fine mean it grabs Mp3 from a folder and show it on a Page .
Now what i want that How we can embed an mp3 player so that there is an
Play Option In Front of every Mp3 File
Like this
Mp3 File Name Play
Mp3 File Name2 Play
Mp3 File Name3 Play
Mp3 File Name4 Play
Help me Please.