Solved

Username connected with userinfo

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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 94
ACK Attack 5 61
OpenWrt 1 53
Issue to mail 11 110
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…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

756 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