I need to access the CGI Variables or HTTP Headers in a request. Can I do that in JavaScript?
Specifically I need to access the CGI variable remote_user.
anyone?
I need to access the CGI Variables or HTTP Headers in a request. Can I do that in JavaScript?
Specifically I need to access the CGI variable remote_user.
anyone?
No - Javascript does not have access to server variables…
the session user is not sent back to the client in the
response header - and since that’s the only information that
js can possibly have access to - that’s it!
The only other way would be to ask it for it using a external file … OR just get a server side langauge to put
it in in the first place…
external version:
<script language=“Javascript” src=“who.pl”></script>
who.pl
#!/usr/bin/perl
print “alert(‘$ENV{REMOTE_USER}’);”;
but personally i’d never use perl - i’d use mason in a js file:
who.js
alert(‘<%$ENV{REMTOE_USER}%>’);
Flawless
OK I see
I saw this too . . .
http://developer.irt.org/script/1206.htm
I am actually trying to get this from the server side using another program that allows for JavaScript so I thought I could get to it.
And just WHAT’S wrong with perl
he he
Flawless