Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Nov 2002
    Location
    Johnson City, NY
    Posts
    2
    Member #
    299
    Hey there,

    I have a site based entirely on a fixed-size IFRAME in the middle of a "loader" page. The loader page is a PHP script that takes a "page" variable (pagename.php?page=blah) and it pulls a particular content page into the IFRAME. You can see it at http://www.markscudder.com. It allows me to create fixed-size art and content without doing messy popups and

    Here's my question. On the offchance somebody loads one of the content pages directly, not through that loader script (actually called frameset.php if you have looked at the site), is there a way using Javascript to detect that it's not in an IFRAME and redirect to another URL (the loader script or the front page)? I don't imagine that anyone would link directly to one of those pages, but if they do, or a spider grabs one by mistake, I'd like to cut off the problem before someone sees something they shouldn't. Any help would be greatly appreciated!

    -Mark

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    I don't know of a way via Javascript (if there is one I bet it's similar to a break-out-of-frames script). You can use PHP though. Just add this to the beginning of the page in the IFRAME:

    PHP Code:
    if (strpos($_SERVER['HTTP_REFERER'], 'yourdomain.com') === false// yes, 3 =s
    {
        die(
    "Don't steal my content!");

    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Junior Member
    Join Date
    Nov 2002
    Location
    Johnson City, NY
    Posts
    2
    Member #
    299
    Oh, duh, yes, I'm sorry, you're absolutely right :-).

    -Mark


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:55 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com