473,473 Members | 2,262 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Request.ServerVariables("HTTP_REFERER") contains nothing; why?

I need to know whether a request for a resource on our web server is coming
from a particular affiliate domain or from another domain. In my testing,
the HTTP_REFERER variable sometimes is empty. Under what circumstances can
it be empty? Is there any way to know the origin of a request, for certain?
Thanks
Jake
Nov 19 '05 #1
4 2575
Hi,

HTTP_REFERER will be empty if the user visited the site without clicking a
link. Also, it is possible that the agent is not sending the referer. Some
security software will prvent a browser from sending this.

The only reliable way to do what you want is to have affliates use a code
sent on the querystring - e.g.
www.yoursite.com/index.aspx?affiliatecode=123456. You could then either do
something with this code in your ASPX page (Like log to a DB) or analyse
your log files. The latter would require that you manually link the
affiliate code to the actual person/company, where as logging to a DB etc
could allow alot more scope, for example you could automatically reward the
affliate when the referer code got to a given value.

Hope that helps!
Simon.

"Jake" <Ja**@spamspamspam.org> wrote in message
news:u8*************@tk2msftngp13.phx.gbl...
I need to know whether a request for a resource on our web server is coming
from a particular affiliate domain or from another domain. In my testing,
the HTTP_REFERER variable sometimes is empty. Under what circumstances can
it be empty? Is there any way to know the origin of a request, for
certain?
Thanks
Jake

Nov 19 '05 #2
Thanks, Simon. I had hoped there was a way that wouldn't require our
affiliates to have to change anything on their end. But if not, not. I've
heard of people limiting traffic to a certain IP address. For example, a web
service that will only accept requests for a specific IP. Are they doing
this perhaps with a firewall, and not with any feature of ASP.NET?
Regards
Jake
"Simon Harris" <to***********@makes-you-fat.com> wrote in message
news:uj**************@TK2MSFTNGP09.phx.gbl...
Hi,

HTTP_REFERER will be empty if the user visited the site without clicking a
link. Also, it is possible that the agent is not sending the referer. Some
security software will prvent a browser from sending this.

The only reliable way to do what you want is to have affliates use a code
sent on the querystring - e.g.
www.yoursite.com/index.aspx?affiliatecode=123456. You could then either do
something with this code in your ASPX page (Like log to a DB) or analyse
your log files. The latter would require that you manually link the
affiliate code to the actual person/company, where as logging to a DB etc
could allow alot more scope, for example you could automatically reward the affliate when the referer code got to a given value.

Hope that helps!
Simon.

"Jake" <Ja**@spamspamspam.org> wrote in message
news:u8*************@tk2msftngp13.phx.gbl...
I need to know whether a request for a resource on our web server is coming from a particular affiliate domain or from another domain. In my testing, the HTTP_REFERER variable sometimes is empty. Under what circumstances can it be empty? Is there any way to know the origin of a request, for
certain?
Thanks
Jake


Nov 19 '05 #3
"Jake" <Ja**@spamspamspam.org> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Thanks, Simon. I had hoped there was a way that wouldn't require our
affiliates to have to change anything on their end. But if not, not. I've heard of people limiting traffic to a certain IP address. For example, a
web
service that will only accept requests for a specific IP. Are they doing
this perhaps with a firewall, and not with any feature of ASP.NET?


No probs :)

Sorry - I think you're going to have to get your existing affilites to
change there links.

I don't see how limiting traffic to given IP addreses would help - Perhaps
I'm missing something?

Simon.
--
I am using the free version of SPAMfighter for private users.
It has removed 2036 spam emails to date.
Paying users do not have this message in their emails.
Try www.SPAMfighter.com for free now!
Nov 19 '05 #4
On Tue, 19 Apr 2005 12:34:12 -0500, Jake <Ja**@spamspamspam.org> wrote:
I need to know whether a request for a resource on our web server is
coming
from a particular affiliate domain or from another domain. In my testing,
the HTTP_REFERER variable sometimes is empty. Under what circumstances
can
it be empty? Is there any way to know the origin of a request, for
certain?
Thanks
Jake


Just to add, browsers like Opera can also do this; I usually have mine
turned off. This way of detecting where a user is coming from has never
been reliable...

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: JW | last post by:
I use Request.ServerVariables("HTTP_REFERER") to get the URL of the referrer page. However, if the page that has Request.ServerVariables("HTTP_REFERER") is in a popup window then the value is...
1
by: JW | last post by:
Sorry, posting this twice as it tagged on to a spetember posting: --------------------------------------------------------------- I use Request.ServerVariables("HTTP_REFERER") to get the URL of...
1
by: JJA | last post by:
When my webserver does not process a user's change because of an invalid password, I inform the user and I want to present them a button for a retry: <TR id=continuebuttonrow> <td...
0
by: Daniel | last post by:
how to change the value of Request.ServerVariables on the ser ver? if not possible is there some way to change it by sending back javascript to the client and having the client automaticaly do...
9
by: Nicolae Fieraru | last post by:
Hi All, I try to use Request.ServerVariables("HTTP_REFERER") in a script and I discovered it doesn't work as expected. I use XP with SP2 and I created a link on a web site which points to an asp...
1
by: srinivas | last post by:
Hi, Request.ServerVariables.ToString(); is not working for all browsers.In netscape it isreturning the current url rather than current url.Is there any alternative method to get the previous...
1
by: Elliot M. Rodriguez | last post by:
..NET Framework 1.1 Has anyone reported or experienced NullReferenceException errors when accessing the HTTP_REFERER value on clients that are behind web blocking software? At least one of...
1
by: ppatel | last post by:
I'm using Request.ServerVariables ("HTTP_REFERER") When i move from normal server eg. http:// to secure server eg https:// in VB Script then I've a problem in getting value of Request.ServerVariables...
0
by: dsivakumar | last post by:
In one of my project, i am in one page, if i try to change the url, it should not go to that page, instead, it should go to user login page. i used the code like this: if(Session == null ||...
1
by: kennyzita | last post by:
how do i go about this, wit the aim of restricting access to a page. If Instr(Request.ServerVariables("HTTP_REFERER"),"page_name") Then thanks
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.