Solved

get $REMOTE_USER .htaccess

Posted on 1998-12-28
7
863 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
[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
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
Containers and Docker for Everyone

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

 
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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to count occurrences of each item in an array.

705 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