One time download

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jco872
    New Member
    • Mar 2008
    • 1

    #1

    One time download

    I have a site that sells a downloadable .mp3 file. After someone downloads it, I don't want them to be able to send the link to someone else to grab for free. Any ideas how I can use PHP to solve this problem?

    Thanks!

    Jeff
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    #2
    Originally posted by jco872
    I have a site that sells a downloadable .mp3 file. After someone downloads it, I don't want them to be able to send the link to someone else to grab for free. Any ideas how I can use PHP to solve this problem?

    Thanks!

    Jeff
    Make an mp3's library in the database with 2 columns. One is the song id, and other is the song name (actual file name).

    In the database, keep the id same, and change the name every time a download is done. Also change the file name of the mp3.

    I hope you got it.

    Comment

    • dlite922
      Recognized Expert Top Contributor
      • Dec 2007
      • 1586

      #3
      Originally posted by hsriat
      Make an mp3's library in the database with 2 columns. One is the song id, and other is the song name (actual file name).

      In the database, keep the id same, and change the name every time a download is done. Also change the file name of the mp3.

      I hope you got it.
      Although i agree with the past, that person could easily send the MP3 file instead of the link in this case, but never the less there should be a less intesive way to do this.

      Look into session. if your URL is like example.com/downloadsong.ph p?songid=2&sid= asldf8938923kad jfhg73af

      SID is set with user login so there for the user who receives the link doesn't share the session and you can stop it.

      IF you still want to go his route:
      per haps you can make a column in the song table for a rotatting ID, and that ID in the base must match an ID in the URL.

      IF you want the logged in, authenticated user to download it once. EVER. then just have a link table that ties the user to each song.

      ID---- USERID--------SONGID
      1 23 299
      2 68 845

      Check for the combination of USERID and SONGID, if it exists, deny them access.

      Comment

      Working...