Link to home
Start Free TrialLog in
Avatar of dmyoung
dmyoung

asked on

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
Avatar of jhurst
jhurst

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.
Avatar of dmyoung

ASKER

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.....

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

let shivers have the points
ASKER CERTIFIED SOLUTION
Avatar of shivers
shivers

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial