Jump to content
xisto Community
gameratheart

How Do I Make A Php "thank You For Downloading Script" thatll say thank you and start the download?

Recommended Posts

In all of my life, every website that I've made has had some form of downloadable on it. Even to today, I am still doing the downloads by linking directly to the download. However, I feel that this is impractical, not user-friendly, and insecure.So now I'm asking a favour of the community. Can you teach me to make a php script that will, when someone visits it, say something like: Thank you for Downloading!Your Download of (filename) will start shortly.Click here to go back to the website.Then it starts a download of the file?Also, is it possible to make it count the amount of times the file has been downloaded, and show that before the "Click to go back" link? Or if not, just one that will count how many times the script has been executed.Many thanks.

Edited by NDPA (see edit history)

Share this post


Link to post
Share on other sites

Thank you for Downloading!Your Download of (filename) will start shortly.
Click here to go back to the website.

This can be done with META redirect to the file. Have PHP dynamically create the META tag for it. Retrieve the URL of the file from the database.

Also, is it possible to make it count the amount of times the file has been downloaded, and show that before the "Click to go back" link?

This part is just basically keeping track of page views (the page for the above quote). You will have to have a database with all download names, urls, and another field for page views. And just add 1 to the current value of page views.
I'm not a MySQL database person, so i can't provide any coding for it.

Share this post


Link to post
Share on other sites

I can't believe that with all my knowledge of coding, I didn't even THINK of using META-Redirects, especially since I've used them before. Thanks mate.I actually don't need a way to retrieve a filename, as I use a portal system which creates php pages for each one anyway, so I can just copy the same coding to each page and change the name myself. It may be a bit more long-winded, but to be honest, I think the time and memory it'd save far outways that.But I still don't know how to do the download counter...

Share this post


Link to post
Share on other sites

I think it would be simple enough to do a counter. I'm working on a counter script actually that might be able to help you out. I don't know when exactly it will be done, but I can PM you once its up and running. If you want an answer right away, I'd be glad to help you too.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.