Solved

Username connected with userinfo

Posted on 1998-10-08
4
176 Views
Last Modified: 2010-03-18
We have a "Username and Password Box" (on Linux) like the pages from experts-exchange. But we want that there is a file on the server with knowes the username and the information (street, telephone number .....) of that user so that when he sends an email (in a form) he only types his username and that the email that comes to us the compleet information of that user attaches.

Is that possible?

Greetings,

Jeffeny
0
Comment
Question by:harryv
  • 2
  • 2
4 Comments
 
LVL 2

Accepted Solution

by:
alexbik earned 200 total points
ID: 1587096
Yes, that's no problem.

If you make some sort of database (can be a text file like /etc/passwd), you can look up the user's info from there. The username the user typed to get into the password protected webpage is available in the environment variable REMOTE_USER.

Note that in order to read the REMOTE_USER variable from the environment, the CGI script you use for this has to be in the protected space as well. In other words, if your secured page is in www.whatever.com/secure, putting a script in www.whatever.com/cgi-bin won't work, unless you protect the cgi-bin dir as well, using /the same/ (!) realm. You can make a dir cgi-bin/secure and put a symlinks in it to the .htacces and .htpasswd files you use. In that way you will only have to update the .htpasswd file in one location, and you will be sure that the realm (the name that apears after 'enter username and password for... in the dialog window of the browser) will be the same.

Alex.
0
 

Author Comment

by:harryv
ID: 1587097
Hello,

Thankx for the answer. But I am not an expert and understand the
answer not completely.
I can make a database file like "nameinfo" but what is next?
Do I have to add the line remote_user = var in the .htdaccess file, because there is more than one user? And if some is mailing
how does it connect to the database?

Sorry for the extra explanation but I understand cgi-scripts a little.

Greetings,

Jeffeny
0
 
LVL 2

Expert Comment

by:alexbik
ID: 1587098
Hi,

You setup the .htaccess and .htpassword files as usual. These may contain more than one user ofcourse. If the CGI script is in the protected directory, you have the environment variable REMOTE_USER available automatically. It is something your webserver software takes care of. So you can search your database for this name.

Alex

0
 

Author Comment

by:harryv
ID: 1587099
Thanks
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question