Solved

Username connected with userinfo

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now