?
Solved

get $REMOTE_USER .htaccess

Posted on 1998-12-28
7
Medium Priority
?
881 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
Cloud Training Guides

FREE GUIDES: In-depth and hand-crafted Linux, AWS, OpenStack, DevOps, Azure, and Cloud training guides created by Linux Academy instructors and the community.

 
LVL 7

Accepted Solution

by:
yoren earned 200 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

Congratulations! You’re Certified – Now What?

Starting a new career can be overwhelming. Becoming certified in your field of expertise is a great start, but where do you go from here?  Here are some tips to help you on your career journey.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
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.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses
Course of the Month8 days, 14 hours left to enroll

764 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