1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Create a login, but without back end coding? Simple Workaround needed!

Discussion in 'Web Design & Development' started by matt.choules, Oct 13, 2008.

Thread Status:
Not open for further replies.
Advertisement
  1. matt.choules

    matt.choules Thread Starter

    Joined:
    Sep 11, 2003
    Messages:
    378
    I am in need of a log-in to a page to either allow or disallow a user to access to another page (if he/she enters correct password or not, username would be nice, but not 100% neccessary, as long as I can assignmore than general password)...

    But I am hosting my website on a home package and so do not have MySQL or anthing fancy like that.

    I do not know much about server coding, and so I want to try and find a simple workaround.
    So far I have managed to find many work arounds, like using Response-O-Matic forms to relay submitted form data via email to my inbox, but I cannot find anything appropriate for this!

    Little help?
     
  2. Techmonkeys

    Techmonkeys

    Joined:
    Feb 10, 2005
    Messages:
    625
    Do you know what your hosting account is using? Windows or Linux?

    You can use a file called .htaccess and htpasswrd to protect directories on your website if you are using Linux hosting.
     
  3. matt.choules

    matt.choules Thread Starter

    Joined:
    Sep 11, 2003
    Messages:
    378
    I have the Home package with 1and1.co.uk, which is linux hosted.
    Where can I find out about .htaccess and htpasswrd ?

    Is it complicated stuff to understand?
    I am competant with XHTML, CSS and a little javascript, but that is all.
     
  4. Techmonkeys

    Techmonkeys

    Joined:
    Feb 10, 2005
    Messages:
    625
  5. matt.choules

    matt.choules Thread Starter

    Joined:
    Sep 11, 2003
    Messages:
    378
    Ok, I've read the tutorial on the page you recommended.
    It all seems to make sense.

    I created the .htaccess and .htpasswd files, and put the .htaccess file in the root folder of the site I wanted to protect.

    Tested it, and the user/password dialogue box appears.
    Cool.

    But the dialogue box will not accept the details that are in the .htpasswd file...
    To begin with i thought it was because the .htpasswd file was in a sub folder and that maybe i defined the path wrong in the .htaccess

    I tried this:

    AuthName "Logged In"
    AuthType Basic
    AuthUserFile /folder/.htpasswd
    Require valid-user

    And then this:

    AuthName "Logged In"
    AuthType Basic
    AuthUserFile http://www.urlname.com/folder/.htpasswd
    Require valid-user

    I then tried moving the .htpasswd to the same root folder as the .htaccess file, and changed the code to:

    AuthName "Logged In"
    AuthType Basic
    AuthUserFile .htpasswd
    Require valid-user

    None of these worked.
    I encrypted the passwords using the KxA Password Encrypter...
    http://www.kxs.net/support/htaccess_pw.html

    So i figured i'd try entering the original user/password, and then the user/encrypted password. Neither worked.

    In summary, the user/pass dialogue box will not accept the login details defined in the .htpasswd file. The dialogue box just reappears. There is no password incorrect or forbidden page/message.

    HELP!
     
  6. matt.choules

    matt.choules Thread Starter

    Joined:
    Sep 11, 2003
    Messages:
    378
    Ok, as I figured it was the fact that my linking to the .htpasswd file was wrong.
    I found a great little free program to help sort it all out automatically.

    I've zipped it up and added a text file in case anyone needs the same thing.
     

    Attached Files:

  7. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/758679

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice