[Help] Random File Download Script

by 4 replies
5
Hi Guys I want to know if there is someone here knows a script on downloading random files.

Example I have a download link and I have different files link like file1 link, file2 link, file3 link etc.

if someone click the download link the script will automatically randomly pick a file on different files link and will automatically download.
#programming #download #file #random #script
  • Easy. Assuming you have 4 files, named file1.zip, file2.zip, file3.zip, file4.zip, and those files are in the same directory as your webpage...

    <a href="<?php echo 'file' . rand(1,4) . '.zip'; ?>">Click here to download</a>

    Just change the '4' to the number of files you have, and be sure to give that page a PHP extension.
    • [1] reply
    • Thanks Brandon, how about if the files are hosted in file hosting website and all I have is the links of the files. How can I do that?

      Example someone pay me in my paypal account and after paying they will receive a random downloaded file. The files are hosting in a file hosting website so how can I do the script?
      • [1] reply

Next Topics on Trending Feed

  • 5

    Hi Guys I want to know if there is someone here knows a script on downloading random files. Example I have a download link and I have different files link like file1 link, file2 link, file3 link etc.