Zubrag.com
December 10, 2018, 10:52:57 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Go to a specific download depending on password?  (Read 4374 times)
ilke
Newbie
*
Posts: 12


« on: November 28, 2012, 09:15:29 AM »

I use both Smart Download and Paaword Protect and am really happy with them! Now I would like to do something but I don't know if it is possible. Here is the situation:

Over a period of twelve months, subscribers get to download 12 different PDF files. Let's call them File1.pdf, File2.pdf, etc.
These files are kept in a downloads folder outside my root director, and I'm using Smart Download for the download links.

So on the page where they get the downloads, it would say something like:

Download <a href="http://mysite/subscribers/download.php?f=File1.pdf">File 1</a>
Download <a href="http://mysite/subscribers/download.php?f=File2.pdf">File 2</a>
etc.

I have protected download.php using Password Protect. All subscribers have a Username and each month they are sent a new password for that month -- let's call them Password1, Password2 etc.
So in my separate file that holds the usernames and passwords, there is:

$LOGIN = array(
'User1' => 'Password1',
'User1' => 'Password2',
etc, all twelve passwords
'User2' => 'Password1',
'User2' => 'Password2',
etc, all twelve passwords
'User3' => 'Password1',
'User3' => 'Password2',
etc, all twelve passwords
);

At the moment, if someone clicks on the download link for File1, he can log in with any of the twelve passwords.

What I would like to happen is this:
- A subscriber clicks on the link for File2.pdf
- He fills in his username and the password for that month
- He downloads the file
- Another subscriber clicks on the link for File2.pdf
- He fills in his username and the password for THE WRONG MONTH
- He gets an error message

I can work this by making twelve different download.php pages and twelve different Password protect login pages, but that is rather cumbersome. Can it be done with one download.php and one login.php ?

Thanks!

Logged
ilke
Newbie
*
Posts: 12


« Reply #1 on: November 28, 2012, 09:17:37 AM »

I forgot something -- is it possible that if someone fills in his username and the password for March, he automatically gets the download for March?
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC