Log in

View Full Version : HELP! Random links for download..



marikatech
09-30-2005, 09:45 PM
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

Twey
10-01-2005, 09:08 AM
How about checking for a hidden input sent via POST?
You could create "random" links; something like:

<?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.