Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Music In Php, i don't get how this works
iwuvcookies
post May 25 2005, 02:11 AM
Post #1


Privileged Member
*********

Group: Members
Posts: 675
Joined: 11-September 04
Member No.: 1,079



Ok i went to a site to listen to music and instead of giving me some file with a mp3 extention they have .php with an id #. Like this....

http://www.emp3world.com/to_download.php?id=53465


i was wondering how would a person do this and what's the purpose of it? is it like for safety reasons?
Go to the top of the page
 
+Quote Post
snlildude87
post May 25 2005, 02:17 AM
Post #2


Moderator
***************

Group: Members
Posts: 2,325
Joined: 8-March 05
From: Mawson, Antarctica
Member No.: 4,254



PHP itself cannot generate music on the fly - not to my knowledge. First of all, the link that you are referring does not work due to massive hotlinking, but if it works, then it would first call the file (or script) "to_download.php". Then, the script would take the id number and find the corresponding .mp3 file for you to download. That's how it would work.
Go to the top of the page
 
+Quote Post
Tyssen
post May 25 2005, 02:25 AM
Post #3



***********

Group: Members
Posts: 1,161
Joined: 9-May 05
From: Brisbane, QLD
Member No.: 6,818



QUOTE(iwuvcookies @ May 25 2005, 12:11 PM)
i was wondering how would a person do this and what's the purpose of it? is it like for safety reasons?

Yes it's a security measure to make sure people can only d/l from the site (usually after having paid) and not via FTP or whatever. If you were paying for MP3s, this would stop you passing the direct link to the file on to your friends so that they could then d/l it (although you could still just send them the file yourself).
Go to the top of the page
 
+Quote Post
badinfluence
post May 25 2005, 03:32 AM
Post #4


Super Member
*********

Group: Members
Posts: 283
Joined: 10-October 04
Member No.: 1,637



hey, i cut and paste in the browser line, it is streaming and reach to back door ..
unsure.gif

and how? huh.gif
Go to the top of the page
 
+Quote Post
Spectre
post May 26 2005, 04:11 PM
Post #5


Privileged Member
*********

Group: Members
Posts: 873
Joined: 30-July 04
Member No.: 246



There are a number of ways in which such a system can work, and a number of reasons for using it. Some of the more common reasons are for security, as has been mentioned, but also for tracking purposes - it's more practical to store the number of times a file has been accessed through a tracking script than look through a log file to count the access attempts.

The ways in which it can work vary. It can be a unique file ID corrosponding to only that file which will then be looked up in the database, but that is more likely to be for tracking purposes than security reasons. If it was for security, it would more likely be a session hash or something else that uniquely identified you and the file you were seeking, rather than a simple file ID. So anyway, after the file is located, it will usually do one of two things: i) Redirect you to the location of the actual file (eg. header('Location: /file.mp3')), or ii) Get the contents of the file and send it to you directly. The latter is more commonly used in situations where security is a priority; if you are redirected to a direct download point, then you can obviously just use that URL again later and not have to go through the initial process.

Hope that helps.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Script Won't Work At Trap17 -- Version Differences?(12)
  2. Error Importing Sql Query Via Php(6)
  3. Making A Sig With Php(7)
  4. Help Improving My Login Script Code(4)


 



- Lo-Fi Version Time is now: 22nd November 2008 - 04:17 PM