SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
-
Jul 24, 2002, 06:22 #1
- Join Date
- Aug 2001
- Location
- DC
- Posts
- 113
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
can you access HTTP Headers in Javascript (Remote_User)
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?signature
-
Jul 24, 2002, 07:16 #2
- Join Date
- Feb 2002
- Location
- Gatwick, UK
- Posts
- 1,206
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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---=| If you're going to buy a pet - get a Shetland Giraffe |=---
-
Jul 24, 2002, 07:21 #3
- Join Date
- Aug 2001
- Location
- DC
- Posts
- 113
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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.signature
-
Jul 24, 2002, 07:24 #4
- Join Date
- Feb 2002
- Location
- Gatwick, UK
- Posts
- 1,206
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
And just WHAT'S wrong with perl
he he
Flawless---=| If you're going to buy a pet - get a Shetland Giraffe |=---
Bookmarks