Advanced Search

Results 1 to 2 of 2

Thread: HELP! Random links for download..

  1. #1
    Join Date
    Sep 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default HELP! Random links for download..

    Hi all,

    Ok this is what I need to do. I sell hypnosis mp3 on my site, and so far, once the customer has paid, they are directed to another page on my site to start downloading their product.

    Now, nothing so far prevents that personb from simply copying the link and sending it to anyone they choose, so that others can get a free download. Unless I change the links daily, this continues to be a problem.

    Is there a way, ...that I can give the customer a download link that will either expire after a time, like 12 hours, or is there a way to create 'random' links, that can only work once?

    Or are there any apps out there that do this kind of thing?

    Thanks...

    marikatech

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    How about checking for a hidden input sent via POST?
    You could create "random" links; something like:
    PHP Code:
    <?php
    $randname 
    md5(microtime()) . ".php";
    $randompage '<?php readfile("hyp.mp5"); unlink($PHP_SELF); ?>';
    $randfile fopen($randname'w');
    fputs($randfile$randompage);
    fclose($randfile);
    ?>
    Go <a href="<?=$randname?>">here</a> for your download.
    Last edited by Twey; 10-01-2005 at 09:12 AM. Reason: Forgot to fclose(). Shame on me.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •