Jump to content

Creating .m3u files dynamically


PC Nerd

Recommended Posts

Hi,

 

Im looking at creating a playlist program for my server.  i have alist of files within my database, and i wanted to be able to place these values into a playlist file.  the problem is that i dont know how to get the database to create the playlist form its records.  ie, if i uploaded a new file to my server and into the database, then i woudl want the script to automatically grab that file ( SQL  i know), anbd the nplace it in the m3u file ( i dont know).

 

Coudl someone recommend a simple method to complete this?  or point me in teh righ t doirection for a tutorial?

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/69314-creating-m3u-files-dynamically/
Share on other sites

i built a script to stream mp3 sermon podcasts for a church.

 

<?php
include('conection_info.php'); //file with mysql connection info
$query = mysql_query("SELECT * FROM sermons WHERE id='$_GET[id]'");
$row = mysql_fetch_array($query);

//update download count to track how many times this sermon has been played -obviously optional
mysql_query("UPDATE sermons SET mp3plays = mp3plays + 1 WHERE id = '$_GET[id]' ");

header("Content-type: audio/m3u");
header("Content-Disposition: inline; filename=".$_GET['id'].".m3u");
?>
http://www.ourwebsite.org/<?php echo $row['mp3Location']; ?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.