Solved

Username connected with userinfo

Posted on 1998-10-08
4
183 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
squid3 ntlm and itunes authentication 5 104
Webmin Bandwidth Monitoring not working 10 190
apache and php 3 162
IPA complaining about DNS but DNS looks good.... 2 166
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

751 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