473,417 Members | 1,566 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,417 software developers and data experts.

How can I tell the page I came from?

I'm trying to know the page that I came from. If I use
page.request.urlreferrer it seems to only be filled in once I am on one of
the pages within my web site. I'd really like to know what page they came
from outside of the web site.

TIA - Jeff.
May 14 '07 #1
7 5087
OJ
On 14 May, 16:04, "Mufasa" <j...@nowhere.comwrote:
I'm trying to know the page that I came from. If I use
page.request.urlreferrer it seems to only be filled in once I am on one of
the pages within my web site. I'd really like to know what page they came
from outside of the web site.

TIA - Jeff.
Hmmm......dubious request Jeff!! I don't think it is (easily)
possible. Why would you want to know that? If I were a user I might
say that is absolutely none of your business!

O

May 14 '07 #2
OK then let's see if somebody can solve my problem.

We have a website that we use for documentation. Rather than have people
actually have to log in to it, I was going to set up links of some of our
other website ( where people already have logged in ) and use the place
where they came from to tell what they can see.

So if somebody went to public.xxx.com/docs - they could see a certain set
of files.
If they went to internal.xxx.com/docs - the could see a different set of
files.....

I would then put a redirect in the /docs that would all go to the same place
and it would figure out what your privileges are based on where you came
from. So everything would go to www.xxx.com.

I believe although I haven't tested it completely, that once you change
domains you lose your session variables. I supposed I could put it in the
query string but I don't particularly want it there because the users could
see it.

Any suggestions?

TIA - Jeff.

"OJ" <of****@gmail.comwrote in message
news:11*********************@y80g2000hsf.googlegro ups.com...
On 14 May, 16:04, "Mufasa" <j...@nowhere.comwrote:
>I'm trying to know the page that I came from. If I use
page.request.urlreferrer it seems to only be filled in once I am on one
of
the pages within my web site. I'd really like to know what page they came
from outside of the web site.

TIA - Jeff.

Hmmm......dubious request Jeff!! I don't think it is (easily)
possible. Why would you want to know that? If I were a user I might
say that is absolutely none of your business!

O

May 14 '07 #3
you should know the page where you came from :)

Just kidding.

There is no way except Request.UrlReferer.
Some advice here.

Do not use Request.UrlRefferer.
Use string sRef = Request.ServerVariables["HTTP_REFERER"];

Also always check it for null. Because a lot of AOL proxies do not pass
referrer.

Also if you get malformed referrer's URL the Request.UrlRefferer will throw
an exception when try to convert it to URI object.

George.


"Mufasa" <jb@nowhere.comwrote in message
news:uK**************@TK2MSFTNGP02.phx.gbl...
I'm trying to know the page that I came from. If I use
page.request.urlreferrer it seems to only be filled in once I am on one of
the pages within my web site. I'd really like to know what page they came
from outside of the web site.

TIA - Jeff.


May 14 '07 #4
"George Ter-Saakov" <gt****@cardone.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
Also always check it for null. Because a lot of AOL proxies do not pass
referrer.
Not just AOL - more and more ISPs are filtering this out - you can't rely on
it at all...
--
http://www.markrae.net

May 14 '07 #5
OK then let's see if somebody can solve my problem.
>
We have a website that we use for documentation. Rather than have
people actually have to log in to it, I was going to set up links of
some of our other website ( where people already have logged in ) and
use the place where they came from to tell what they can see.

So if somebody went to public.xxx.com/docs - they could see a
certain set
of files.
If they went to internal.xxx.com/docs - the could see a different set
of
files.....
*if* those site really are named <something>.fixeddomain.com, you could
store a cookie with domain "fixeddomain.com". That way all those <something>
sites can receive that cookie.
From there it's up to you again ...

Hans Kesting
May 14 '07 #6
The problem is that if somebody types the address into the browser's address
bar and didn't get there by clicking on a link, there won't be anything there.
That's just the way HTTP works.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Mufasa" wrote:
I'm trying to know the page that I came from. If I use
page.request.urlreferrer it seems to only be filled in once I am on one of
the pages within my web site. I'd really like to know what page they came
from outside of the web site.

TIA - Jeff.
May 15 '07 #7


"Mufasa" <jb@nowhere.comwrote in message
news:#D**************@TK2MSFTNGP03.phx.gbl...
OK then let's see if somebody can solve my problem.

We have a website that we use for documentation. Rather than have people
actually have to log in to it, I was going to set up links of some of our
other website ( where people already have logged in ) and use the place
where they came from to tell what they can see.

So if somebody went to public.xxx.com/docs - they could see a certain
set of files.
If they went to internal.xxx.com/docs - the could see a different set of
files.....

I would then put a redirect in the /docs that would all go to the same
place and it would figure out what your privileges are based on where you
came from. So everything would go to www.xxx.com.

I believe although I haven't tested it completely, that once you change
domains you lose your session variables. I supposed I could put it in the
query string but I don't particularly want it there because the users
could see it.

Any suggestions?

TIA - Jeff.

"OJ" <of****@gmail.comwrote in message
news:11*********************@y80g2000hsf.googlegro ups.com...
>On 14 May, 16:04, "Mufasa" <j...@nowhere.comwrote:
>>I'm trying to know the page that I came from. If I use
page.request.urlreferrer it seems to only be filled in once I am on one
of
the pages within my web site. I'd really like to know what page they
came
from outside of the web site.

TIA - Jeff.

Hmmm......dubious request Jeff!! I don't think it is (easily)
possible. Why would you want to know that? If I were a user I might
say that is absolutely none of your business!

O

]

[TROLL TIME FOR A SINGLE POST]
I think it's the public.XXX.com that OJ doesn't want you to KNOW!!!
Mythran

JK of course...

May 15 '07 #8

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

Similar topics

2
by: qaz | last post by:
I have login links on a number of pages in my site. Some of the pages expect variables on the querystring. I want to be able to login from any of these pages. The login link redirects me to a...
9
by: Ian Richardson | last post by:
If I follow the steps on http://www.dhtmlcentral.com/tutorials/tutorials.asp?id=11 to add .js files to a document on demand, let's say by <body onload="blah();">, how can I reliably tell that it...
10
by: pmelanso | last post by:
Hello, How can I tell if there is a page to go back to in the history or not??? Same with forward??? say something like/// if (there is a page to go back to ) { // DO something }else { }
1
by: .Net Newbie | last post by:
I am relatively new to .Net and have been coding an intranet site for my employer for a couple of months. I am currently stuck coding in a text-editor called EditPlus without access to the VS.Net...
2
by: Lauchlan M | last post by:
Hi. I'd like to put a button on my ASP.NET pages that sends them back to the previous page (as opposed to them having to use the browser back button). I can think of two ways to do this: ...
3
by: Amil | last post by:
I have a .aspx page that creates proprietary images (return type is image). Normally, calls to this .aspx page come from our own pages. I don't want someone to just type the URL for the .aspx image...
3
by: Dan Sikorsky | last post by:
How can I get the Querystring passed to the Referring Page from its referrer? I don't want the querystring coming to my current page. I want the querystring that came to the referring page, so...
0
by: Sam | last post by:
I am fairly new to ASP. Net 2.0, background MS Access 2000/2003 and working knowledge of SQL 2000. Scenario: Page1: Blank Page loads with 2 Text Boxes (TxtLast, TxtFirst), a Command...
3
prabunewindia
by: prabunewindia | last post by:
Hello everyone!, I developed a website page with IFrame. It was working fine. When a new modification came, I done some modification on the page called in iframe. before it was done in .Net 2003....
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
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...

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.