JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old August 9th, 2004, 04:50 AM
katey katey is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Auckland, New Zealand
Posts: 1 katey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Help for a Total Newbie! Referrer Info in Pop-Up Window Needed

Hi,

I'm pretty much a total newbie when it comes to javascript, but I'm hoping some kindly person out there could please help me with a problem.

I have a page on my website which is being linked to directly from domains other than mine. Therefore I want to restrict access to this page unless the visitor has accessed the page from my own domain.

For example:
"http://www.example.com/test.html" should only be viewable when the referrer is either "http://www.example.com/menu.html" or "http://www.example.com/menu2.html".

I found the perfect script that I want to utilise:

<script language="javascript">
var allowedreferrer = new
Array("http://www.example.com/menu.html","http://www.example.com/menu2.html");
if (document.referrer.indexOf(allowedreferrer) == -1) {
alert("You can only access this page from http://www.example.com");
window.location="http://www.example.com";
}
</script>

The problem is that my "test.html" page opens via a javascript pop-up window when a link is clicked in "menu.html" or in "menu2.html", and I don't know how to pass the referrer information into this pop-up. Is this possisble to do via javascript somehow on the client side?

If anyone can please help me I'd really appreciate it.

Thanks so much in advance,
Kate.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Help for a Total Newbie! Referrer Info in Pop-Up Window Needed


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


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

Iron Speed




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