jyushinx Posted January 17, 2008 Share Posted January 17, 2008 Hi, What I am trying to do is have a setup where a person clicks on Accept (for Terms & Conditions) and is then directed to a page thanking them for their download and in 10 seconds or so, the download prompt will appear asking them to save or open the file. It's a common thing on a lot of websites (downloading drivers for one). One other thing is that I don't want the path to the file to be seen by the user. The way I have it setup now, the user clicks on Accept, which is linked to a PHP script forcing the download. The downloadable file is put in a directory a few levels down so the user can't attempt to use the script to download a PHP file. The problem is, I don't know how to load a page and use this method (which uses headers). Thanks for your help. Quote Link to comment https://forums.phpfreaks.com/topic/86467-downloading-a-file-automatically/ Share on other sites More sharing options...
Ninjakreborn Posted January 17, 2008 Share Posted January 17, 2008 Pretty much when they click on the accept link it takes them to a page with javascript doing a time wait. it's not too hard. 1-2 lines of javascript code will count down whatever amount you want, THEN execute the action set to execute after the timer runs. So it won't be too hard to put it into your current system without having to drastically change everything. Google (Javascript time delay) or something similiar. Quote Link to comment https://forums.phpfreaks.com/topic/86467-downloading-a-file-automatically/#findComment-441844 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.