• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 214
  • Last Modified:

password protect based on userID

i need to be able to provide access to files specific to a userID from a single login screen. I have already created the login screen, but need to know what code to attach and how to specify a USERID gets a prespecified file.

thanks
0
dmyoung
Asked:
dmyoung
  • 2
  • 2
1 Solution
 
jhurstCommented:
typically one uses the .htaccess system of the web server.  With this you just specify the directory with the files is to be protected and set up user names and passwords for the directory and the system does everything else for you.

If you really want to re-invent the wheel and do it yourself then you should set a cookie when the user name and password is accepted and then all further access to your site will pass that cookie.  You can then check that cookie in the cgi that you use to send the files.  This is definitely not the recommended method.

By the way, the former method is the method used by this system, experts-exchange, if you select the non-cookie method of logging in.
0
 
dmyoungAuthor Commented:
thanks for note, but i am looking for more specifics.....

As in how to create the password file and the access file, where to place them, etc.....

0
 
shiversCommented:
i dont wanna grab jhurst's points, but for info on how to set up .htaccess stuff see this URL for the NCSA spec:

http://hoohoo.ncsa.uiuc.edu/docs/tutorials/user.html

for simpler information, see the basic instructions on the Earth Host web site (some stuff may need to be changed to suit your ISP):

http://www.earth-host.com/passprotect.htm

0
 
jhurstCommented:
let shivers have the points
0
 
shiversCommented:
thanx jhurst - but you got ther first - see other question - i'll give u half

for info on how to set up .htaccess stuff see this URL for the NCSA spec:

http://hoohoo.ncsa.uiuc.edu/docs/tutorials/user.html 

for simpler information, see the basic instructions on the Earth Host web site (some stuff may need to be changed to suit your ISP):

http://www.earth-host.com/passprotect.htm 
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now