Results 1 to 4 of 4

Thread: link to my site hiding address bar - need to unhide.

  1. #1
    Join Date
    Sep 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default link to my site hiding address bar - need to unhide.

    Someone is pointing to my site and hiding the address bar using popup window javascript. I would like to unhide it. adding code to my htaccess works but I have to put the sites domain in the code. Is there another way to prevent webmasters from doing this?

    Thank you, I look forward to hearing any possible solutions.

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Hmm... how annoying.

    I don't think that there's a way to alter the properties of an existing window.

    There are several approaches you could take:

    Just to name a few--

    1. Use window.close() and window.open() to close the current window and open a new instance, as you want it.
    However, that will be automatic, unless you were to limit it by the referring site.

    2. Use the referring site to redirect to your main site if it either: a) doesn't match an "ok" list, or b) matches a "not ok" list.

    3. You could use PHP to track all referring sites, and try to find a pattern to determine which is doing this. From there, you could react with the .htaccess or above methods.

    4. You could ask the webmaster of the other site to stop, or try to pursue that some other way, though I'm not really sure what would work best, since I don't think there is a specific legal way to claim s/he's doing something wrong.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Sep 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks for the quick reply. I put code in so no one can put the site in iframes. someone did it already. I prefer automatic rather than having to search for webmaster/sites linking in all annoying ways.

    The option below sounds like a possibility. I would prefer automatic but either option of unknown or limiting to the known referrer would be better than nothing. Can you point me in a direction where I can find the code to do something like this? sounds like it be javascript? (javascript close window open new window from referring site)

    Use window.close() and window.open() to close the current window and open a new instance, as you want it.

    However, that will be automatic, unless you were to limit it by the referring site.

    thank you

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    The trouble with that script is that you don't really have a way to verify that the visitors are from your site or not. The HTTP_REFERER tag works in some cases, but it can also be faked and sometimes not sent at all. However, generally, that would be able to help you.

    Code:
    <?php
    $ref = isset($_SERVER['HTTP_REFERER'])?$_SERVER['HTTP_REFERER]:'';
    if ($ref!=''&&!strpos($h,$n)) {
    echo '<script type="text/javascript">
    window.opener=self;
    window.open(\'http://my.com\');
    window.close();
    </script>';
    ?>
    another good option would be to use sessions in PHP, but you'd still need a way to start these knowing the visitor was there legitimately. If you just start it on their first page load, it could be from this hijacked page.


    Really, from your other post, it sounds like you have bigger problems to worry about than people linking to your page in an unfriendly manner.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •