#1
  1. No Profile Picture
    matthewdoucette.com
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2002
    Posts
    635
    Rep Power
    12

    only way to read document.referrer with javascript?


    is the only way to read document.referrer with javascript? or can i do it with cgi somehow?

    i need to read referrers from one html page to another html page.
    Matthew Doucette / Xona.com
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2002
    Posts
    548
    Rep Power
    0
    Didn't we have a long conversation about this already?

    Code:
    $ENV{'HTTP_REFERER'}
  4. #3
  5. No Profile Picture
    matthewdoucette.com
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2002
    Posts
    635
    Rep Power
    12
    yes we did, but i thought that HTTP_REFERER only returned the source that calls the CGI program that uses HTTP_REFERER. so HTTP_REFERER is not the document.referrer, but instead the HTML file that spawns the CGI program. however...

    i never thought until after i posted that if I use SSI to call the CGI, instead of javascript, then it's server-side, and then the HTTP_REFERER is the document.referrer. also, .htaccess calling the CGI would be the same thing.

    are those 2 ways the only way to do it?
    Matthew Doucette / Xona.com
  6. #4
  7. No Profile Picture
    matthewdoucette.com
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2002
    Posts
    635
    Rep Power
    12
    I've decided to trade referrers with $ENV{'HTTP_REFERER'} and SSI.

    However I keep getting the same domain name over and over again, my own!! What is happening?


    It is called via this SSI code:

    <!--#exec cgi="/cgi-bin/tracker/tracker.cgi"-->


    And the referrer is called inside tracker.cgi with this code:

    $referrer = $ENV{'HTTP_REFERER'};
    Matthew Doucette / Xona.com
  8. #5
  9. No Profile Picture
    matthewdoucette.com
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2002
    Posts
    635
    Rep Power
    12
    I figured it out. It was because the HTML that called the CGI (via SSI) was in a frame.

    Is there anyway to get CGI to read the parent referrer?
    Matthew Doucette / Xona.com

IMN logo majestic logo threadwatch logo seochat tools logo