|
| |
|
|
GrantB
Posts: 13 From: Bath, UK Status: offline
|
Hiding URL - 4/15/2003 5:36:10
Hi, Has anyone any ideas on how to hide a URL from the address bar in the browser? I have some javascipt to generate a password protected login that leads to a ' Contacts' page but I don' t want the browser to display the URL of that contacts page when it is reached. Any help would be appreciated. Grant
|
|
|
|
Justjay
Posts: 697 From: Montreal, QC Canada Status: offline
|
RE: Hiding URL - 4/15/2003 7:16:15
You would probably find it easier to leave the display of the URL alone as you can find it in more than just the ADDRESS bar....however you can use a Javascript to control where the user comes from. I would suggest looking for a javascipt that will allow you to set the page that the visitor MUST COME FROM in order to view your contact page, if they attempt to view the contact page from a bookmark, for example, they will be redirected to a login request page.... Try looking here or maybe here
_____________________________
JustJay thejehm.net Web Solutions SAH Link Exchange Serious About Hosting
|
|
|
|
GrantB
Posts: 13 From: Bath, UK Status: offline
|
RE: Hiding URL - 4/15/2003 12:05:34
Justjay Great idea but I just can' t get it to work! I' ve added the following script (taken from one of the references you gave) to the Contacts page: <script> <!-- var validreferrals=new Array() validreferrals[0]=" http://www.javascriptkit.com/script/cut170.shtml" validreferrals[1]=" http://javascriptkit.com/script/cut170.shtml" var passed=0 for (r=0;r<validreferrals.length;r++){ if (document.referrer.indexOf(validreferrals[r])!=-1){ passed=1 break } } if (passed==0){ alert(" Access to the page denied!" ) history.go(-1) } //--> </script> But it still refuses to let me in even if I come from a vaild page. Any ideas? Many thanks. Grant
|
|
|
|
Justjay
Posts: 697 From: Montreal, QC Canada Status: offline
|
RE: Hiding URL - 4/15/2003 12:19:42
Thats because you didnt change what pages you could come from as a valid referral --> validreferrals[0]=" http://www.javascriptkit.com/script/cut170.shtml"
validreferrals[1]=" http://javascriptkit.com/script/cut170.shtml" So here is my idea...change the pages that are valid referrals and then it should work
< Message edited by justjay -- 4/15/2003 12:20 PM >
_____________________________
JustJay thejehm.net Web Solutions SAH Link Exchange Serious About Hosting
|
|
|
|
GrantB
Posts: 13 From: Bath, UK Status: offline
|
RE: Hiding URL - 4/15/2003 13:05:14
Sorry, didn' t make it clear but I had already changed the valid referral pages. I just pasted the original code. So I' m still stuck. Cheers, Grant
|
|
|
|
GrantB
Posts: 13 From: Bath, UK Status: offline
|
RE: Hiding URL - 4/16/2003 4:27:46
Here you go: <script> <!-- var validreferrals=new Array() validreferrals[0]=" http://www.keynshamsquashclub.org.uk/conlogin.htm" validreferrals[1]=" http://www.keynshamsquashclub.org.uk/contacts.htm" var passed=0 for (r=0;r<validreferrals.length;r++){ if (document.referrer.indexOf(validreferrals[r])!=-1){ passed=1 break } } if (passed==0){ alert(" Access to the page denied!" ) history.go(-1) } //--> </script> The ' conlogin' page successfully directs me to the ' contacts' page but every time it shows the ' Access to the page denied' alert. I do appreciate your help. Grant
|
|
|
|
Justjay
Posts: 697 From: Montreal, QC Canada Status: offline
|
RE: Hiding URL - 4/16/2003 7:38:45
Try removing this line...since you don' t want people to bookmark that page.... validreferrals[1]=" http://www.keynshamsquashclub.org.uk/contacts.htm"
_____________________________
JustJay thejehm.net Web Solutions SAH Link Exchange Serious About Hosting
|
|
|
|
GrantB
Posts: 13 From: Bath, UK Status: offline
|
RE: Hiding URL - 4/16/2003 7:43:25
Hi Line removed but the script still doesn' t work! Any other ideas? Grant[:j]
|
|
|
|
Justjay
Posts: 697 From: Montreal, QC Canada Status: offline
|
RE: Hiding URL - 4/16/2003 8:19:45
Okay I have given it a whirl and can' t get it to work either. To the best of my limited JS knowledge everything looks right so I am just as lost with you on this one... So know I can suggest 2 options... #1 - find another script #2 - since you have FrontPage Server Extensions you could create a sub-web called contacts, set the page that has your contacts as the index page of this sub-web and then use FPSE permissions to password protect this subweb by turning off anonymous browsing and then setting up users
_____________________________
JustJay thejehm.net Web Solutions SAH Link Exchange Serious About Hosting
|
|
|
|
GrantB
Posts: 13 From: Bath, UK Status: offline
|
RE: Hiding URL - 4/16/2003 8:21:55
Okay, Thanks for your help anyway. Grant
|
|
|
|
abbeyvet
Posts: 5095 From: Kilkenny Ireland Status: offline
|
RE: Hiding URL - 4/16/2003 9:55:54
No answer for your specific problem, but I would caution against using JavaScript to protect anything if it is in any way important that it be protected. It is invariably easy peasy to get around.
_____________________________
Katherine :: InKK Design :: InKK Domains
|
|
|
|
Gil
Posts: 7533 From: North Carolina, USA Status: offline
|
RE: Hiding URL - 4/16/2003 11:47:08
Wht not password protect the pages w/ .htaccess?
_____________________________
Gil Harvey, 1947-2004
|
|
|
|
GrantB
Posts: 13 From: Bath, UK Status: offline
|
RE: Hiding URL - 4/16/2003 11:52:12
Gil, Please forgive my ignorance. How do you do that? Grant
|
|
|
|
Gil
Posts: 7533 From: North Carolina, USA Status: offline
|
RE: Hiding URL - 4/16/2003 12:08:04
First, I assume everyone is on a Unix/Apache server - my bad. If you are then take a look here: http://bignosebird.com/passwd.shtml
_____________________________
Gil Harvey, 1947-2004
|
|
|
|
Justjay
Posts: 697 From: Montreal, QC Canada Status: offline
|
RE: Hiding URL - 4/16/2003 12:35:42
You can still use .htaccess if your Adminstrator has allowed it. But keep looking at JavaScripts...there are more than one...However my comments about using a subweb would be more secure than a JS
_____________________________
JustJay thejehm.net Web Solutions SAH Link Exchange Serious About Hosting
|
|
|
|
Gil
Posts: 7533 From: North Carolina, USA Status: offline
|
RE: Hiding URL - 4/16/2003 12:36:22
quote:
It' s a Linux server so no joy I think. I should have said *nix - Linux supports .htaccess great.
_____________________________
Gil Harvey, 1947-2004
|
|
|
|
Nancy
Posts: 3626 Joined: 11/9/1999 From: Nebraska Status: offline
|
RE: Hiding URL - 4/18/2003 2:58:14
Maybe this is something that will work for you: http://www.supernovacomputers.com/cgi-bin/main?doc=freepass Nancy
_____________________________
Easy Estimates -- is a simple to use tool to quickly build a Web site page enabling visitors to quickly and easily create an estimate of the cost of services that you provide.
|
|
|
|
GrantB
Posts: 13 From: Bath, UK Status: offline
|
RE: Hiding URL - 4/18/2003 4:33:21
Thnaks Nancy, I' ll give it a go. Grant
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|