View Full Version : link to my site hiding address bar - need to unhide.
oldworldcharm
09-15-2007, 02:26 PM
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.
djr33
09-15-2007, 02:45 PM
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.
oldworldcharm
09-15-2007, 05:10 PM
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
djr33
09-16-2007, 12:55 AM
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.
<?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.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.