Solved

get $REMOTE_USER .htaccess

Posted on 1998-12-28
7
824 Views
Last Modified: 2013-12-25
if im running a cgi, i can get a var-env $REMOTE_USER and know the user login name... but how the experts-exchange's site put(get) my login name in their page??? how does it get my name using HTML??

   cox [edit], etc, etc
0
Comment
Question by:cox
7 Comments
 
LVL 6

Expert Comment

by:PBall
ID: 1857498
how the experts-exchange's site put my login name in your site using HTML format???

huh?

0
 
LVL 1

Author Comment

by:cox
ID: 1857499
Edited text of question
0
 
LVL 1

Author Comment

by:cox
ID: 1857500
Edited text of question
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 7

Accepted Solution

by:
yoren earned 50 total points
ID: 1857501
Cox,

The cool thing about CGI is that anything you print out gets sent back to the browser. So, just include the variable in your CGI as part of the HTML you return. Here's an example CGI in Perl:

print "Content-type: text/html\n\n";
print <<ENDOFTEXT;

<HTML>
<HEAD><TITLE>Ekspert Ekschange</TITLE></HEAD>
<BODY><H1>
ENDOFTEXT

# Did we get a REMOTE_USER environment variable?
if ($ENV{'REMOTE_USER'}) { #yes
  print "Logged in as $ENV{'REMOTE_USER'}";
}
else { #no
  print "Not logged in.";
}

print "\n</H1></BODY></HTML>\n";


0
 
LVL 1

Author Comment

by:cox
ID: 1857502
i want know if this site uses only cgis in their pages... because im reading the file htttp://www.experts-exchange.com/topic/index.htm for example, and the variable is showed....
0
 
LVL 4

Expert Comment

by:martinag
ID: 1857503
Check out Q.10109635.

Martin
0
 
LVL 7

Expert Comment

by:yoren
ID: 1857504
My guess is that the entire Expert's Exchange web site is run by CGI's (or other similar technology, like NSAPI, etc.). You can bet that even though you're specifying index.htm, you're not reading a plain HTML file. Something gave you a dynamic page. A CGI program can do this by reading the PATH_INFO environment variable, which would contain "/topic/index.html". The CGI would then parse this and understand that this path means it should display the main topic page.

There are several other technologies that can do this instead of CGI, but they all are similar in concept. A program gets the equivalent of CGI's REMOTE_USER value and returns a dynamic page.

If you want to avoid the overhead of CGI (which runs a new process for every hit), you can look into Microsoft's ISAPI, Netscape's NSAPI, or Sun's Servlet API. These all load your CGI-like program into memory and then just spawn a thread for each hit. Much more efficient.

Yuval
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Accessibility and Usability are two concepts that seem to be closely related.  But, too many people seem to have a distorted perception of them. During last five years, those two words have come to the day-to-day work of almost every web develope…
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will learn how to dynamically set the form action using jQuery.

708 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

14 Experts available now in Live!

Get 1:1 Help Now