473,785 Members | 2,698 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Request.ServerV ariables("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 2601
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**@spamspams pam.org> wrote in message
news:u8******** *****@tk2msftng p13.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******** ******@TK2MSFTN GP09.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**@spamspams pam.org> wrote in message
news:u8******** *****@tk2msftng p13.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**@spamspams pam.org> wrote in message
news:%2******** ********@TK2MSF TNGP15.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**@spamspams pam.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
14065
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 blank!! Can anone assist as to how to solve this problem. The requesting page is at http://www.theexperts.co.uk/error.htm
1
2604
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 the referrer page. However, if the page that has Request.ServerVariables("HTTP_REFERER") is in a popup window then the value is blank!! Can anone assist as to how to solve this problem.
1
5823
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 width="05%">&nbsp;</td> <TD width="90%" align=center valign=middle colspan=2> <BUTTON TYPE=BUTTON ONCLICK="location.href='<% = Request.ServerVariables("HTTP_REFERER") %>';"
0
1499
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 something to change the value of Request.ServerVariables I would like to reset the value in Request.ServerVariables
9
2980
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 page which should show the referer. I placed a link on www.eleader.com.au/linkref.html and there is a link pointing to www.monitortest.net/referer.asp When I use my computer with XP SP2, and I click on the first link, I get no referer. But when...
1
2551
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 url in dotnet. Thanks,
1
2095
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 our customers uses the WatchDog WebBlocker product. Our web app would throw NullReferenceException errors on the following line (assigning a Hyperlink control's NavigateURL property to the HTTP_REFERER value):
1
3669
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 ("HTTP_REFERER") variables..
0
1815
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 || Request.ServerVariables == null) { Response.Redirect("UserLogin.aspx"); } its working fine. but when i want to go to particular page with querystring, it is not going to particular page, instead it is going...
1
1799
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
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10327
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9950
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
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 we have to send another system
2
3647
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.