...

View Full Version : Limited page access Security



DR.Wong
03-19-2005, 04:38 PM
Hey guys,

How do I make a page check the browser's history and only if it comes from a certain page, will the page in question be displayed. If the page detects that the user has navigated from 'a.htm' instead of 'b.htm' the javascript redirects the user to 'security.htm'

Do you get it?

It does not have to use history, just thats the only way I can see the js working.
This only has to work with IE 5+

Thanks! :thumbsup:

mark87
03-19-2005, 04:58 PM
document.referrer gets the last page the user visited, so you could write a script to check what the page was and if it wasn't b.htm then it redirects them to the security.htm page.

EDIT - ... thought I may as well post the script as well!



if (document.referrer = "a.htm")
location.href = "security.htm"

DR.Wong
03-19-2005, 06:58 PM
If you would be so kind...

It would be a great help! :)

I am not so familiar with this kind of stuff.

Thanks! :thumbsup:

mark87
03-19-2005, 09:31 PM
Have a look at

http://www.js-examples.com/javascript/?view=551



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum