Q&A for How to Password Protect a Web Page

Return to Full Article

Search
Add New Question
  • Question
    Is there a way to set up automatic access to a password protected page for someone who subscribes to a membership and pays a fee?
    Community Answer
    That would be very advanced and you would need to be great at php or node.js (server side stuff).
  • Question
    How can I edit the look of the button? Not the text, but the actual font color and background.
    Jordan Dunton
    Community Answer
    You can add a class or ID to the element and use CSS to customize the input form.
  • Question
    How can I do this with HTML instead of JavasScript?
    Community Answer
    That is not possible. HTML is readable to everyone, so it won't work. Try to do it with HTCACCESS and HTCPASSWORD files.
  • Question
    I may be wrong, but isn't method one basically useless? Isn't the password stored in plain text in the source of the website useless?
    Community Answer
    My advice would be to place the script into a separate .js file, then name it something random - like 12e1ek12ej1ioejoi23. But you are right; this is not a secure method. Still, it is cool to show your friends or just stop random people accessing an unimportant page.
  • Question
    How can I open a new page on the password page?
    Community Answer
    You insert the name of the page you wish to go to after inputting the password on this line: window.open('INSERT HERE');
  • Question
    How do I use multiple password protection on a web page?
    Community Answer
    If you want to be able to have multiple passwords, you can just add them to the if statement separated by the || operator, which is Javascript's or operator.
  • Question
    Entering the correct password merely takes the user to another page which is not password protected. What is the point?
    Community Answer
    Many websites are now adopting h t t p s (secure) pages across websites. However, many are still only set to protect the log-in page. Updating entire websites to use all-secure pages can be tricky. At least your password is still protected. That is, your password is not exposed on non-secure pages. But trackers (and hackers including state-level surveillance) can follow what you do on non-secure sites.
  • Question
    I run a site for my high school classmates. I want to password protect the section of the website with their bios and contact info. One password for each person. Do I just have one username?
    Jake Phillips
    Community Answer
    You can do it how you want! Using one account is not as safe, because one username is the only line of defence to all of them. You would much rather have multiple usernames, so if one is compromised, you have only lost one set of data. But one account it easier to manage. Either have multiple accounts, or have on account and change the password frequently.
  • Question
    The password script works fine on MacOS but it doesn't work on iPad or iPhone. Is there a fix for this?
    Julia
    Community Answer
    MacOS isn’t the same as iPhone iOS, so there isn’t really a real fix that exists.
  • Question
    Once you enter the password, that page or directory remains unlocked. So I can close the browser window, come back later and it is still unlocked. Any way to lock it?
    Community Answer
    Clear your cookies/cache. That removes what's telling the website who you are, and will lock it till you log in again.
Ask a Question

      Return to Full Article