Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

back to homepage script? 1

Status
Not open for further replies.

boyfromoz

Technical User
Feb 1, 2001
469
0
0
AU
I want surfers who come into my site to be booted back to the homepagfe is they came in on another page.

I've got a framed site, not suitable to use a framejammer and if someone comes in on the wrong frame I want them to go to the front page.

Anyone?

 
I'm not sure how to do it with JS, but you could use the cgi variable HTTP_REFERER to see where they came from. If it's blank, or something other than what you want, you could redirect them to your home page. Kevin
slanek@ssd.fsi.com
 
You could make your own sort of framejammer which tests not for the presence of frames, but for the correct frames. Maybe something like:

Code:
<script language=&quot;JavaScript&quot;>
<!-- 
if (top.location != &quot;[URL unfurl="true"]http://www.yourdomain.com/framesetpage.htm&quot;)[/URL] { top.location.replace(&quot;[URL unfurl="true"]http://www.yourdomain.com/framesetpage.htm&quot;);[/URL] } // -->
</script>

That way, if your frameset page isn't the top page, it will redirect the user. This will at least prevent people from coming in on a single frame and not being able to see the rest of your site. Did this partially or completely solve your problem?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top