|
Posted by petersprc on 10/07/06 01:22
To disable the context menu (right-click or context key), you can use
this:
<body oncontextmenu="return false;">
See here for more info:
http://javascript.about.com/library/blnoright.htm
In addition, you can check the referrer URL which will block some
attempts to access the page by just pasting the URL in the browser.
(This can be circumvented by the user however because the referrer can
be spoofed.) Here's an example:
function checkReferrer($uriPath)
{
$from = '#^https?://' . preg_quote($_SERVER['HTTP_HOST']) .
'((?-i)' . preg_quote($uriPath) . ')$#i';
if (!isset($_SERVER['HTTP_REFERER']) ||
!preg_match($from, $_SERVER['HTTP_REFERER'])) {
die();
}
}
//
// Pass the path to your referrer script here:
//
checkReferrer('/path/to/script.php');
Best Regards,
John Peters
Axel Gallus wrote:
> I want to realize the following....
>
> The user logs in to a certain webpage (username & password).
> Then the user sees a html page with a link in it.
> This link is a target="_blank" link, so it would open in a new Internet
> Explorer window.
> Normally the user has the possibility to go on that link (without clicking
> with left mousebutton),
> pressing the right mouse button, going on copy location, open a new
> browserwindow by
> himself (even if it is a totally other browsertype),
> copy the link location in it, and access the url of the link in this manner.
>
> I want to prevent this. He should only be able to open the link by pressing
> the left mousebutton,
> otherwise he should have to log in again.
>
> Is this possible, if yes - how?
>
>
> A.G.
Navigation:
[Reply to this message]
|