Solved

Username connected with userinfo

Posted on 1998-10-08
4
190 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

Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

617 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