SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    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

  2. #2
    Perl/Mason Guru Flawless_koder's Avatar
    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 |=---

  3. #3
    SitePoint Zealot
    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

  4. #4
    Perl/Mason Guru Flawless_koder's Avatar
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •