/    Sign up×
Community /Pin to ProfileBookmark

Protecting my webpage

Hi all!
I have a slight problem using a javascript password. I am using this JS
[url]http://javascript.internet.com/passwords/three-tries.html[/url]
It works just fine but whoever knows the protected html page and can specify the address, he can go to it directly and in this case the page is not protected.
I need to correct this thing and to have my webpage protected no matters what the viewer access, log-in page or the protected page. For example, I need a code to put it somewhere in the protected page, so if someone knows its address, he can not view its content and would be referred to log in page to access the protected page.
Please help.. I need it soon.
Thanks

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@Zach_ElfersDec 08.2002 — <script language="JavaScript" type="text/JavaScript">

if (document.referrer != "logpage.html") {

self.location.href = "logpage.html";

}

</script>

Put this script in the password protected page. logpage.html is the page where one would log in. If the user does log come from the log page, this script will put them there anyway.

No matter what you do you can not keep your page safe with this script. Anyone could view the source, and people who know how to get information from JavaScript could find the password. I would recommend storing this in an external JS. It won't stop people from finding the password, but it will help. To make an external JS. Copy the JavaScript code, but not the <script language="JavaScript"> and the </script> parts. Just the contents. Then paste them in a new file and save that file as *.js Now type <script language="JavaScript" type="text/JavaScript" src="script.js"></script> on the page where you want you script to appear.
Copy linkTweet thisAlerts:
@Beach_BumDec 08.2002 — if your site is built using frames (so it is not in top.location) then you can use this to bounce someone to another page if they directly link to it:

if (top.location==self.location) {

self.location.replace("xxxx.htm") }

but this is still not foolproof. they could build their own frameset with a link or they could just turn off javascript.

but with the js you are using you can see the page name anyway in the js. not a good example to use. this one on the same site is a little better as the page name is not stored in the js.

http://javascript.internet.com/passwords/gatekeeper-in.html

but you really need to use an SSL server if you want full protection. this stuff is not security - just makes it harder to find.
Copy linkTweet thisAlerts:
@Beach_BumDec 08.2002 — zach -

ms disabled document.referrer in IE3 and earlier. they were concerned about it being a security problem.

not sure about other browsers.
Copy linkTweet thisAlerts:
@kareemauthorDec 08.2002 — Thanks Zack and Beach!

I used both codes but I could not get it right. If I access the protected page directly, it would refer me to the login page and when i come from the login page, it would take me to the protected page and then take back to the login page, and I could not stay there; at the login page..

Please consider that I am a baby at this regard, consider including some details ..

I appreciate your prompt responses
Copy linkTweet thisAlerts:
@Beach_BumDec 08.2002 — post what you have and maybe we can fix it.

but remember - any of the solutions in this thread are NOT real security for your page as I said in the earlier post. any of these solution can eaily be circumvented by someone with reasonable knowledge.
Copy linkTweet thisAlerts:
@kareemauthorDec 09.2002 — Hi friends,

I wanna give up for this moment. I would like to try something else. I will be saving the content of the webpage including folders and files into a CD, I will distribute this cd to my friends who want to keep the pics and movies on the way the organized as a website. But, I need to include on this cd something to prompt the user to download the whole site into his pc. I wonder whether there is a way that I can do it other than having a zip file.

Does this task need special knowledge?

Thanks
Copy linkTweet thisAlerts:
@Beach_BumDec 09.2002 — kareem -

since you have a whole new question you should really post it as a new thread with a new title in order to get repsonses to what is now your question.

and maybe you can clarrify the question as well:

"my friends who want to keep the pics and movies on the way the organized as a website"

i don't uinderstand what you are trying to do.
×

Success!

Help @kareem spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...