directly typing url in address bar

V

vips

how can we identify whether the web page is opened by typing the link in the
address bar or it opened by clicking it from one of the previous pages ??

Is there any way to find this out .....I want the page to open only if it
come from the previous page and not by directly typing the url of my webpage
!!

vips
 
N

Nick Goloborodko

vips said:
how can we identify whether the web page is opened by typing the link in the
address bar or it opened by clicking it from one of the previous pages ??

Is there any way to find this out .....I want the page to open only if it
come from the previous page and not by directly typing the url of my webpage
!!

vips

Hi,

Basically i'm poking in the dark here, but i guess what you want here is
to use Request.Headers["Referrer"] (note: since i have not done this
before you would have to figure out the exact implementation details
your self). If the Request.Headers["Referrer"] is empty (possibly null)
then the page has been access directly, else the page has been referred
to from another website (you will get the URL value of the referring page)

Hope this helps,

Nick Goloborodko
http://nickgoloborodko.com
 
M

Matt Berther

Hello vips,

A somewhat reliable way is to check for Request.UrlReferrer. Some servers
and firewalls strip this out, so be aware of that.
 
D

darrel

If the Request.Headers["Referrer"] is empty (possibly null)
then the page has been access directly, else the page has been referred
to from another website (you will get the URL value of the referring page)

This can also be null if the end-user is using some software on their
machine that blocks this information...such as NAV, I believe.

There probably isn't a sure-fire way to do this.

-Darrel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top