Beginner Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherBeginner Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old September 13th, 2002, 04:29 PM
Chiles4 Chiles4 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: Nuevo Mexico, U.S.
Posts: 86 Chiles4 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 26 m 38 sec
Reputation Power: 6
Need to see if "referrer" is inside/outside my site

I need to find out if someone has accessed my site's main page from outside my entire site or from a page within my site. What's the most straightforward way to do this? Should I just see if my domain's URL is found in the document.referrer property?

if (document.referrer&&document.referrer!="")
{
if (document.referrer.indexOf("https://www.mydomain.com")>=0)
{
...visitor came from within my site...
}
else
{
...visitor came from outside my site...
}
}

How does that look?...0 being the first position in the string. And can someone tell exactly why the line (document.referrer&&document.referrer!="") is always used when this property is referred to? Wouldn't document.referrer!="" suffice? Does it translate in English to "not null AND not empty" or something?

UPDATE TO POST: I started by putting code on a page to display the document.referrer. When I key it into my Yahoo Store Editor it works perfectly displaying actual web URLS of the editor itself. When I "publish" the page on the net, the page just gives me nothing but a "blank page". It's like the document.referrer property is always null. Currently stumped.

Last edited by Chiles4 : September 13th, 2002 at 05:10 PM.

Reply With Quote
  #2  
Old September 14th, 2002, 11:17 AM
Acid Reign Acid Reign is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 190 Acid Reign User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 57 m 52 sec
Reputation Power: 7
Send a message via ICQ to Acid Reign
The referrer property is being sent by less and less internet browsers. This is because some people see it as an invasion of privacy and also because of the fact that firewallsare more common.

Reply With Quote
  #3  
Old September 14th, 2002, 03:03 PM
Chiles4 Chiles4 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: Nuevo Mexico, U.S.
Posts: 86 Chiles4 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 26 m 38 sec
Reputation Power: 6
I had a feeling that might be the case. I also realized that my approach was flawed because alot of people don't come to my site through my main page anyway - which would short-circuit my algorithm. I'll come up with another idea. Thanks.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherBeginner Programming > Need to see if "referrer" is inside/outside my site


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway