Discussion Questions about PHP points download

Source: Internet
Author: User
Tags readfile
Discussion PHP points Download problem
I used PHP to build a station, download files need to deduct the cost of account, now encountered a thorny problem.
With Thunderbolt for the first download, members of the Thunderbolt address to other people, others can also download, paid download becomes free.

Are there any good ways to solve a similar system that has been developed by talent?

------Solution--------------------
Members submit a URL, want to download, Thunderbolt put the URL and user storage.

Others request the same URL, Thunderbolt found the URL has been used by a user member, so decided to provide you with free download, immediately start to return resources.
------Solution--------------------
Database to store a bit. Check to see if this user has downloaded before downloading.
------Solution--------------------
You give the real address to the user, of course, it doesn't matter the points downloaded

You need to always complete the download through PHP, you search for PHP breakpoints to continue to get the solution
------Solution--------------------
Do not jump to the real file address Ah,, with ReadFile output file content, note the output before sending the relevant header ~

Reference Address: Http://cn2.php.net/readfile
------Solution--------------------
Explore

I don't know what I mean.

No matter how you verify that the user has downloaded it, the actual address of the file has been obtained once it has been downloaded.

For example, the user downloads the 127.0.0.1/a.rar file through the 127.0.0.1/down.php file, the first time it can be verified by down.php, verifying the successful jump to the actual address 127.0.0.1/ A.rar start to download, this time the 127.0.0.1/a.rar address has been exposed, users can skip down.php ...
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.