PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi,
I want to keep mp3 files away from the public but allow them to download the mp3 files if they are members to my site. They can also listen to the mp3 files through an embedded media player on the site and if they wanted to, they can download via a php script.
in the embedded script I point the src to the mp3 file as /home/me/mp3/example.mp3 and it works.
My problem is how to make the file accessible when the user trys to file. I am using the follwing code for testing purposes:
thats the only code I have in the php file and when i point the browser to the php file, it downloads the php file. when i open the php file i see a bunch of jibberish.
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
ok I figured out how to force download and all is working fine for files located outside the webroot, but i spoke to soon in regards to the embedded player being able to play the mp3 file located outside of the webroot.