Need Help With Simple HTML Log In

by 9 replies
11
Hi,

Need a little help here. I need a very simple html code that would allow me a login on a website that could use the same name and password.

If there is a code available and where would it be placed. Is this possible? The login would be for the index page.

Thanks for your help
#programming #html #log #simple
  • Hi,
    this is not possible with HTML only (if you want it to be somewhat secure).
    You'd need to use an .htaccess file (and a .htpasswd file containing user/password combinations) on the server to achieve that.
    Or you could use PHP for that purpose.
    What's available to you?
    • [1] reply
    • I don't need it to be completely secure just block the index page. I could create a .htaccess file and .htpasswd file but what would I include in thos files to make a login happen at the point of the index page?
      • [1] reply
  • Much appreciated! Thanks a ton this will help.
  • Mark, that's easier than patching fiberglass. You don't need to edit your index page at all. Instead, use .htaccess to limit the access to this page.

    Here's another handy-dandy little tutorial I found with a Google search for ".htaccess password":
    Password Protecting Your Pages with htaccess

    Now there is an important, serious limitation with this technique of basic HTML authentication. The limitation is that if someone is eavesdropping on your Internet connection, they'll be able to read the user ID and password in plain text. The eavesdropper could then go to the site themselves, and type in the user ID and password they just stole.

    Be aware that basic authentication is like an easily picked little plastic lock. Ethical people will recognize the intention to lock the door, and not bother it. Unethical people might go get a butter knife and slide right on in. To more securely lock up your page requires more sophisticated authentication techniques. A great place to start would be using SSL to encrypt the connection, so that eavesdropping is blocked.

    If the password is simply to prevent people who haven't paid from reading more articles about fiberglass, then you should be reasonably safe with this basic access control. It's unlikely that someone who eavesdrops on passwords would steal or misuse that information in a way that hurts anyone.

    If your web page will contain anyone's personal, confidential information, you should use one of the more robust forms of access control. If you're collecting something like credit card numbers, fiberglass boat registrations, addresses of homeowners with fiberglass showers, etc., then you could be in legal hot water if you don't use more than this minimal .htaccess trick to protect their information.

    I hope this is enough to get you started!

    Chris
    • [ 1 ] Thanks
  • Thanks Chris very helpful
  • Hey,

    I got it! Actually that was pretty simple once you understand. Once again I appreciate all the help guys.
    • [1] reply
    • That's my favorite follow-up message to see around here. Way to go!
  • Thanks for this. I was looking for a simple way to password protect a website too. I tried with .ht access but for some reason probably to do with the way my blogs are set up using wp-hive it didn't work and ended up password protecting a number of other pages on the same site.

    In the end I went with .php and found this very simple free solution so thought I would share it with anyone else looking.

    :: Web Page Password Protect :: Free PHP Scripts
  • Banned
    [DELETED]

Next Topics on Trending Feed