• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 21. JavaScript Project: Setting ... > The First Real Solution: A Trick for...

The First Real Solution: A Trick for Hiding the Password

The password protection given by the script in Listing 21.3 is reasonable, but there will still be a non-trivial subset of users who will see through the ruse of hiding the password and filename as codes. What you really need is a solution where the password and filename of the protected page are nowhere in sight. How is that possible? By using a trick: Make the password the same as the filename, minus the extension. For example, the protected page I've been using as an example is named secret.htm, so the password would be "secret."

Trying Out the Trick

Listing 21.4 shows a page that implements this solution.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint