Solved

get $REMOTE_USER .htaccess

Posted on 1998-12-28
7
854 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
Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

 
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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Why "Mobile First"? 5 60
locate sql commands in C# visual studio Project 6 63
WordPress Page Content Lost 2 46
Keyup listener getting fired on initial page load 1 47
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

739 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