0

I already read this question and this question.

I was planning to make this

enter image description here

I am working on static html(s) with lots of HTML and files like this:

https://i.stack.imgur.com/FXEoP.png

In order to create an "enter the site, write down the given password", I need to create a different .html.

If the user entered the password correctly, they will be redirected to the main site (on this case, they will be redirected to here.html) and if the password is wrong, the user will stay on the same page until they write a correct password.

How to make that function/password page?

I want the user unable to dig out by the source to find out the password. It will be just simple password.

Community
  • 1
  • 1
Skinny Totoro
  • 75
  • 1
  • 2
  • 9

1 Answers1

0

If you want to keep the password secret, then you cannot give it to the browser (since anything you give to the browser, you give to the user).

This means that you must check the password using server side code.

The closest you could come without using server side code would be to make the password part of the URL. If the wrong password was entered, the user would go to the wrong URL and get a 404 error.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • yeah I tried not to involved php since it's a simple static html(s) .. but it's kinda impossible hiding the password if i still use js :/ and umm how can I do the "make password part of the url"? Thank you in advance! – Skinny Totoro Jul 27 '13 at 11:49
  • Create a directory called `v7g78g76g80h98`, put the files in it, the user has to know that `v7g78g76g80h98` exists. – Quentin Jul 27 '13 at 11:50