Page 1 of 1

Stopping a user from browsing via the address bar?

Posted: Sun Dec 08, 2002 10:38 am
by DynamiteHost
Hello,

How would I be able to stop a user from using the address bar of their browser to navigate a section of my site? I want it so they have to click the links to navigate....

Thanks!

Posted: Sun Dec 08, 2002 11:08 am
by f1nutter
You could open your site up in a new window with JavaScript. Just leave out the address bar. Have a look at the JavaScript documentation to find out what you can put in the third parameter.

Code: Select all

window.open('page_name.htm', 'window_name', 'width=600,height=800');
However, you could view the source of the page, find the link, and open a full browser your self. PHP won't be able to help here, its server-side, and this is a client-side problem.

Posted: Sun Dec 08, 2002 12:49 pm
by DynamiteHost
The thing is, I know it can be done with Perl because i've seen it...
i'm not sure about PHP though.... there must be some sort of way even if its complicated...

:(

Posted: Sun Dec 08, 2002 2:09 pm
by Sunthas
Can't you setup Apache and certian directories using .htaccess to only allow access to files when linked from within? Same way you keep someone from using their images on your website without hosting them themselves.

Posted: Sun Dec 08, 2002 2:57 pm
by hob_goblin
you would have to make a form for each link and then use javascript to submit it by the click of a link, then use POST to determine the content.

Posted: Sun Dec 08, 2002 5:34 pm
by dusty

Code: Select all

if(empty($_SERVER['HTTP_REFERER'])) die("Do not enter URLS manually");
try putting this at the top of your pages

Posted: Mon Dec 09, 2002 12:47 pm
by DynamiteHost
Thanks dusty, thats exactly what i'm looking for!

How would I be able to do this:

Code: Select all

if NOT (empty($_SERVERї'HTTP_REFERER'])) {

}
Thanks :)

Posted: Mon Dec 09, 2002 5:19 pm
by dusty
if(!empty($_SERVER...

Posted: Mon Dec 09, 2002 5:22 pm
by volka
whenever the client sends a referer the script shall die?
unlikely ;)

Posted: Tue Dec 10, 2002 11:26 am
by DynamiteHost
er... it works so.... whatever...