View Full Version : Is PHP what I need??

12-03-2008, 05:02 AM
Ok, I have tried everything I know but am not sure how to make this happen; it seems like it should be easy so here goes.

I have started a website for guitar chord charts and other resources. It's main goal is to equip worship leaders and teams. Part of this goal is to offer an mp3 of the song to listen to online for practice purposes. But I obviously need to protect these somehow.

[please do not launch into a discussion on how you cannot fully protect an mp3 online; I realize this] :confused:

So right now if you go to this page: http://www.thebenjaminresource.com/html/browse_by_title.html you will see song titles followed by icons. The furthest icon to the right is a speaker icon. When you click on this it enacts soundpop.js which opens a small window and places the mp3 inside with the information. (see it in action by clicking the top most speaker next to the song titled '40')

What I am needing is to stop the 'right-click' ability. I'm thinking there should be a way to protect that folder unless it is accessed by my javascript. So any other attempt (whether right-click, or external linking) would be denied access to my folder of music.

Any help would be extremely appreciated!

Thanks in advance!

12-03-2008, 05:12 AM
You cannot disable right-clicking using php as php is a server-side technology. You'd want to look into JavaScript (client-side), and I won't bother saying how futile an attempt it will be.

12-03-2008, 05:23 AM
Thanks for the response.

But if I can't disable the right click, can I not go about it by protecting the folder that the mp3s are in?

Thanks again

12-03-2008, 05:32 AM
While you can take steps to protect the files from direct access and/or hotlinking, the essential problem is that in order for a browser to display anything (or, in this case, "play" it), the file must be present on the user's computer.

So, even taking the step of disabling right-click (through JS) is really useless, since the file is, in fact, on the user's system.

12-03-2008, 07:09 AM
What I would do is find a flash mp3 player or create your own that allows you to create a prefix in the .fla file. The prefix will be a folder that only you know the name to. It will be appended to any mp3 url that you give to the flash player. I do this on a site that I manage and it has cut down a lot on people direct linking to mp3s. Search for "JW FLV MEDIA PLAYER" in google to find a player that is capable of doing this. I would give you a link but it gets picked up as spam.

12-03-2008, 11:58 AM
Thanks so much for the quick responses!

I'll definitely try to get in and mess with some flash.

Does JW FLV Player allow me to embed it in my pop up window? I would really like to keep it in there mainly because I don't really have the spare real estate to have the player on the page.

Thanks again guys,

12-03-2008, 06:30 PM
Yes. It helps to just try it you know.

12-03-2008, 10:43 PM
Ok, obviously sensing a little frustration. I appreciate your help, but please if this is wearing on you, move on. I apologize for my second question, but I have been sent on many paths from 'experts' such as yourself that ended up requiring me to change my entire layout. I merely assumed that if you had experience with this script, you might be able to send a quick answer (2-3 letters would suffice) and possible save me many wasted hours.

Thank you again for your help

12-03-2008, 10:59 PM
Yes I use it on all of my sites. Why wouldn't it work in a popup? A popup contains a normal html page. If it works on an html page it will work in the popup. It wouldn't take hours to get working. It would take maybe 15 minutes if that. What I'm getting at is there is documentation on that site to get the player working. There are even common questions and answers.

12-03-2008, 11:51 PM
Sorry for stepping on you're toes AE, but I'm going to move this to General Webbuilding. Let one of the client mods know if it should be in a different one (doesn't seem to quite match JS alone).