Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Sep 2007
    Location
    Carrollton, TX
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    CGI.HTTP_REFERER blank!

    ok I am trying to track visitors to our website. We use a link at the bottom of the page to cature the information:

    img src="http://xxxxxxx.com/w.cfm?l=63&r=#CGI.HTTP_REFERER#" border="0" width="0" height="0"

    Here is the code that process it:
    Code:
    <cfquery name="insertWebpageOpenInfo" datasource="clicktrackSystem">
    	  INSERT INTO Clicks (linkID, ipAddy, referer, agent)
              VALUES (<cfqueryPARAM value = "#url.l#" CFSQLType = 'CF_SQL_INTEGER'>, "#CGI.REMOTE_ADDR#", <cfqueryPARAM value = "#url.r#" CFSQLType = 'CF_SQL_VARCHAR'>, "#CGI.HTTP_USER_AGENT#") 
    </cfquery>
    Everything inserts fine, but when I google our site, or yahoo, or ask it, the referer is blank. I have also tried just using links from other websites...nothing works, the referrer is always blank. Any suggestions?

    <3Kacie

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,641
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Do you have privacy enabled in your browser or firewall? Either one can blank out the referrer field so that web sites can't tell where you came from.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #3
    Regular Coder
    Join Date
    Jul 2002
    Location
    Las Vegas, NV - USA
    Posts
    104
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've found that REFERER is one of the least dependable of the CGI variables. It seems almost anything can block the information - security settings on browsers, security settings on firewalls, browsers using different interpritations of the HTTP spec (some only report referer on POST and not the more common GET).

    Also, a side note, I hate the REFERER is misspelled.
    Steven Sommers (blog)
    Shift4 Corporation -- www.shift4.com

    Creators of $$$ ON THE NET(tm) payment processing services.

  • #4
    New to the CF scene
    Join Date
    Sep 2007
    Location
    Carrollton, TX
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I just don't know because the R E F E R E R works in other places. I have made this tracking system myself, with the help of my boss, and its to track links and open rates on e-mails. Well this is another part of it. It sends the R E F E R E R when the e-mails are opened through a web mail service like yahoo or gmail. It also works if I don't put it in a variable (like shown in the code above) for the website, only the R E F E R E R is the websites homepage, since that is where the 'picture' is being accessed from. So this is why I had to put it in the URL variable so that it would capture the R E F E R E R from the site they were coming from and not from the site the picture is accessed on. I am thinking something must be up w/ my code.

  • #5
    New to the CF scene
    Join Date
    Sep 2007
    Location
    Carrollton, TX
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Thumbs up I fixed it

    the problem was here:

    img src="http://xxxxxxx.com/w.cfm?l=63&r=#CGI.HTTP_REFERER#" border="0" width="0" height="0"

    this link is created in the tacking system and then displayed so you can cut and paste it where ever you need it, here was the code that made the link to be displayed for cutting and pasting:

    Code:
    #HTMLEditFormat('<img src="http://glyphlink.com/w.cfm?l=#getLinkInfo.linkID#&r=##CGI.HTTP_REFERER##" border="0" width="0" height="0">')#
    What I was missing was cfoutput

    Code:
    #HTMLEditFormat('<img src="http://glyphlink.com/w.cfm?l=#getLinkInfo.linkID#&r=<cfoutput>##CGI.HTTP_REFERER##</cfoutput>" border="0" width="0" height="0">')#
    so now when the link is displayed to cut and paste is shows <img src="http://glyphlink.com/w.cfm?l=XX&r=<cfoutput>#CGI.HTTP_REFERER#</cfoutput>" border="0" width="0" height="0">
    why it wanted cfoutput to process the R E F E R E R? I don't know, but whatever it works now, thanks for your help
    Last edited by supersssweety; 09-05-2007 at 07:33 PM.


  •  

    Posting Permissions

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