Go Back   CodingForums.com > :: Server side development > Other server side languages/ issues > ColdFusion

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-04-2007, 09:48 PM   PM User | #1
supersssweety
New to the CF scene

 
Join Date: Sep 2007
Location: Carrollton, TX
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
supersssweety is an unknown quantity at this point
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
supersssweety is offline   Reply With Quote
Old 09-04-2007, 10:45 PM   PM User | #2
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,448
Thanks: 0
Thanked 496 Times in 488 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
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/
felgall is offline   Reply With Quote
Old 09-05-2007, 04:51 PM   PM User | #3
Shift4Sms
Regular Coder

 
Join Date: Jul 2002
Location: Las Vegas, NV - USA
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
Shift4Sms is an unknown quantity at this point
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.
Shift4Sms is offline   Reply With Quote
Old 09-05-2007, 06:59 PM   PM User | #4
supersssweety
New to the CF scene

 
Join Date: Sep 2007
Location: Carrollton, TX
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
supersssweety is an unknown quantity at this point
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.
supersssweety is offline   Reply With Quote
Old 09-05-2007, 07:24 PM   PM User | #5
supersssweety
New to the CF scene

 
Join Date: Sep 2007
Location: Carrollton, TX
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
supersssweety is an unknown quantity at this point
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..
supersssweety is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:33 PM.


Advertisement
Log in to turn off these ads.