amars Posted January 5, 2011 Share Posted January 5, 2011 hey guys a novice coder needs help here. I have about 10 downloads on a single page. Clients wants that when visitor clicks on one download it takes you to a form. Once the form is necessary information completed and form filled and submitted the download begins. Now when they click on another download it would download instantly without the need to fill out any form. How can I achieve this in a most basic manner in php with reasonable security? Link to comment https://forums.phpfreaks.com/topic/223519-download-authentication-problem/ Share on other sites More sharing options...
litebearer Posted January 5, 2011 Share Posted January 5, 2011 so once a user has completed the form they are to be allowed access to all the downloads? Link to comment https://forums.phpfreaks.com/topic/223519-download-authentication-problem/#findComment-1155373 Share on other sites More sharing options...
amars Posted January 5, 2011 Author Share Posted January 5, 2011 Yes. Link to comment https://forums.phpfreaks.com/topic/223519-download-authentication-problem/#findComment-1155374 Share on other sites More sharing options...
Zurev Posted January 5, 2011 Share Posted January 5, 2011 I would set a session once they've filled out the form, then for each download check if the session is registered if not redirect them to the form, otherwise, they can download the file. Link to comment https://forums.phpfreaks.com/topic/223519-download-authentication-problem/#findComment-1155378 Share on other sites More sharing options...
amars Posted January 6, 2011 Author Share Posted January 6, 2011 ok. here's the structure. downloads.php has all the links to various files. visitors can select whatever file they want to download from the server and click it. then a pop up window would open and ask you to fill out the form. a sessions variable called "filename" will be stored with a variable to recognize the file that visitor clicked. once the form is filled out, submit button sends all details to "pro.php". this file will save all "POST" data into session variables. It then sets a session variable called "download" to "true". now i need to POST all the form data to my formmail.pl and start the download for the file which was clicked by retreiving "filename" and take the user back to downloads.php. when visitors click any download "download" variable will be checked. if it's true then download begins instantly, otherwise popup form. Questions: How do I send variables without making forms? How can I POST to formmail.pl, start the download by retreiving FILENAME and take the user back to downloads.php, all in one click? Link to comment https://forums.phpfreaks.com/topic/223519-download-authentication-problem/#findComment-1155468 Share on other sites More sharing options...
amars Posted January 6, 2011 Author Share Posted January 6, 2011 anyone??? Link to comment https://forums.phpfreaks.com/topic/223519-download-authentication-problem/#findComment-1155602 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.