WEB Password Protect HTML page

Discussion in 'OT Technology' started by Letum, Feb 22, 2008.

  1. Letum

    Letum Step aside, I'm a Scientologist

    Joined:
    Jun 8, 2007
    Messages:
    644
    Likes Received:
    0
    Location:
    Perth, Western Australia
    I was wondering if someone can help me with my site.

    I need to password protect a html page.

    I have created a form on my login page with username and password fields.

    Can anyone help me find or tell me where to find some code to get it all working?.

    Any help at all would be great. And the simpler the better
     
  2. Jesse

    Jesse PSN: iamajesse; XBL: Inhale My Rod; G8 GT crew; Ne OT Supporter

    Joined:
    Jan 12, 2005
    Messages:
    25,649
    Likes Received:
    0
    Location:
    California :: (925)
    htaccess.
    google.
     
  3. hurleyint1386

    hurleyint1386 Someone has sand in their vagina

    Joined:
    Jan 6, 2005
    Messages:
    3,687
    Likes Received:
    0
    Location:
    Rochester, NY
    That's just about the simplest you're going to get.
     
  4. Letum

    Letum Step aside, I'm a Scientologist

    Joined:
    Jun 8, 2007
    Messages:
    644
    Likes Received:
    0
    Location:
    Perth, Western Australia
    I have a Password protected Folder on my site that uses .htaccess. Will it password protect a html file and allow my to enter the Username and Password on another html page?

    I have checked google but I had no luck. the only thing i found was for Protecting PHP with a login but not html
     
  5. retorq

    retorq What up bitch??

    Joined:
    Dec 14, 2006
    Messages:
    6,061
    Likes Received:
    0
    Location:
    Mohave Desert
    No it ill protect everything in that folder ... why not give us some more detail as to what you are doing ...
     
  6. Letum

    Letum Step aside, I'm a Scientologist

    Joined:
    Jun 8, 2007
    Messages:
    644
    Likes Received:
    0
    Location:
    Perth, Western Australia
    I need to have a page with a username and password field. that username and password needs to open another page. I need the code that will make it work.

    Sorry if the info doesn't help. My boss decided to have me work on some sites for him, cause i am the one that works here and knows about computers. But i know nothing about PHP or HTML
     
  7. try googling "password protect javascript form"
     
  8. lukin87

    lukin87 New Member

    Joined:
    Jan 11, 2008
    Messages:
    135
    Likes Received:
    0
    dude you are going about it completely wrong.

    you can't do stuff like that using pure html.

    you can do it with javascript, but it is very easily hacked.

    you'll need to look into php.
     
  9. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,924
    Likes Received:
    11
    Location:
    Los Angeles
    Wirelessly posted via wap.offtopic.com (lolphone: Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A93 Safari/419.3)

    Single HTML documents cannot be manipulated like that.
     
  10. Letum

    Letum Step aside, I'm a Scientologist

    Joined:
    Jun 8, 2007
    Messages:
    644
    Likes Received:
    0
    Location:
    Perth, Western Australia
    That did it. Thanks for the help
     
  11. nashstradamus

    nashstradamus New Member

    Joined:
    Nov 2, 2003
    Messages:
    899
    Likes Received:
    0
    Location:
    East Coast, USA
    so what did u end up doing to work this out?
     
  12. just know that this is not secure and your login/password can easily be found in the source code
     
  13. ez4me2c3d

    ez4me2c3d Cold Member

    Joined:
    Sep 19, 2003
    Messages:
    1,836
    Likes Received:
    0
    Location:
    Minneapolis, MN
    it depends on how you do it.

    what if you took the username (jsmith) and password (Passw0rd), mashed it together and stuck .html on the end (passcode = jsmithPassw0rd.html) then did a location.href = passcode.

    Either A) it's going to fail, or B) is going to load the page.

    When it loads jsmithPassw0rd.html, do a redirect to the protected content. Obviously you want to turn off directory browsing on the folder that contains your passcode documents.



    For the record, I would not recommend JS for this, I'm just saying.
     
  14. retorq

    retorq What up bitch??

    Joined:
    Dec 14, 2006
    Messages:
    6,061
    Likes Received:
    0
    Location:
    Mohave Desert
    Doing it this way that second doc that loads doesn't require a password to access if some already knows the URL ...

     
  15. ez4me2c3d

    ez4me2c3d Cold Member

    Joined:
    Sep 19, 2003
    Messages:
    1,836
    Likes Received:
    0
    Location:
    Minneapolis, MN
    that should be obvious for any of the JS solutions.

    if you are not carrying over session variables to the rest of the site, anyone directly linking into an "inside" page will have access.
     

Share This Page