Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Regular Coder Doctor_Varney's Avatar
    Join Date
    Mar 2008
    Location
    Midlands, UK
    Posts
    649
    Thanks
    45
    Thanked 29 Times in 28 Posts

    How Do I Password-Protect My Webpage?

    I want to make a webpage to upload photographs, viewable only to select users. When they arrive, I want them to see a password login. Once they are through, then they can view the designs.

    Where to begin?
    Do I need to talk to someone at Virgin Internet or can I do it myself?
    Can it be done with HTML or will I need some other kind of programming language?

    Thanks

    Dr. V
    Last edited by Doctor_Varney; 01-05-2010 at 11:50 AM.
    Definition: Computer rage is a heightened physiological response with associated feelings of anger and frustration[1] resulting from using a computer or other complex electronic device. It may result in the physical assault of the computer or similar item.[2] Computer use often leads to verbal abuse and occasionally physical violence towards the object.[3] Computer rage may be caused by distress due to a hardware or software problem which the enraged person is unable to correct.

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    You need a server-side language (+ a Data Base) which will analyze a HTML submit - most commonly PHP/MySQL

    Or you may use a .htaccess password (but for an unique user/pass) - most commonly for Apache web servers.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    Regular Coder Doctor_Varney's Avatar
    Join Date
    Mar 2008
    Location
    Midlands, UK
    Posts
    649
    Thanks
    45
    Thanked 29 Times in 28 Posts
    Where/how do I learn how to use this "PHP/MySQL"? Is there something I can download?

    I just need something very simple, to offer peace of mind to the client.
    Last edited by Doctor_Varney; 01-05-2010 at 11:58 AM.
    Definition: Computer rage is a heightened physiological response with associated feelings of anger and frustration[1] resulting from using a computer or other complex electronic device. It may result in the physical assault of the computer or similar item.[2] Computer use often leads to verbal abuse and occasionally physical violence towards the object.[3] Computer rage may be caused by distress due to a hardware or software problem which the enraged person is unable to correct.

  • #4
    Regular Coder Doctor_Varney's Avatar
    Join Date
    Mar 2008
    Location
    Midlands, UK
    Posts
    649
    Thanks
    45
    Thanked 29 Times in 28 Posts
    I must add, this can't be complicated or I'll have to abandon it. I'm doing so much work on the designs, there is no time to learn a new complicated language. Is there some kind of template I can download or would anyone be willing to share some code with me, that they have used?

    Edit: I have just found this http://www.javascriptkit.com/howto/htaccess.shtml
    Which I couldn't find before, because I didn't know that I should be looking up .htaccess in the first place. I just looked up 'how to make a password'.

    Many thanks

    Dr. V
    Last edited by Doctor_Varney; 01-05-2010 at 12:07 PM.

  • #5
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Quote Originally Posted by Doctor_Varney View Post
    I must add, this can't be complicated or I'll have to abandon it. I'm doing so much work on the designs, there is no time to learn a new complicated language. Is there some kind of template I can download or would anyone be willing to share some code with me, that they have used?

    Many thanks

    Dr. V
    Once again: There is no way. You may prevent the right click (but probably only in some browsers), but why to do that? It will be of no use.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #6
    Regular Coder Doctor_Varney's Avatar
    Join Date
    Mar 2008
    Location
    Midlands, UK
    Posts
    649
    Thanks
    45
    Thanked 29 Times in 28 Posts
    Now I've just hit a road block, because the author doesn't explain what he's saying.

    "htaccess files must be uploaded as ASCII mode, not BINARY. You may need to CHMOD the htaccess file to 644 or (RW-R--R--)."

    Can anyone please explain above sentence, please? Because I haven't a clue what he's talking about!

    Dr. V

  • #7
    Regular Coder Doctor_Varney's Avatar
    Join Date
    Mar 2008
    Location
    Midlands, UK
    Posts
    649
    Thanks
    45
    Thanked 29 Times in 28 Posts
    Quote Originally Posted by Kor View Post
    Once again: There is no way. You may prevent the right click (but probably only in some browsers), but why to do that? It will be of no use.
    No, I'm not interested in what mouse button people are using... I want a password login, as I said. Even I have circumvented non-right click pages. The point is, I don't want just anyone to see the designs. I don't care whether they can download them or not, the designs have to stay entirely secret.

    So where can I find code that will do this for me? Links, please?

    Dr. V
    Last edited by Doctor_Varney; 01-05-2010 at 01:03 PM.

  • #8
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    password login? Use a server-side application and a DB.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #9
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Quote Originally Posted by Doctor_Varney View Post
    Now I've just hit a road block, because the author doesn't explain what he's saying.

    "htaccess files must be uploaded as ASCII mode, not BINARY. You may need to CHMOD the htaccess file to 644 or (RW-R--R--)."

    Can anyone please explain above sentence, please? Because I haven't a clue what he's talking about!

    Dr. V
    The ASCII versus BINARY mode thing is a setting in your FTP client. And your ftp client will let you set the permissions which is what CHMOD is for. Once you've uploaded the file onto the server.

    htaccess will let you have username and passwords like you want however the login form will be a pop up dialog from the browser, it won't let you have the form on the page. It still may suffice for what you want though.

    However the more robust solution is as Kor said to use a server side script with a database.
    Last edited by oracleguy; 01-05-2010 at 04:29 PM.
    OracleGuy

  • #10
    Senior Coder
    Join Date
    Oct 2008
    Location
    Long Beach
    Posts
    1,196
    Thanks
    36
    Thanked 164 Times in 164 Posts
    If you want it simple...


    1) Create a new file and name it ".htaccess" (you may need to create this directly on your server if you are using Windows for development because Windows requires a string before the extension).


    2) Open up ".htaccess" and copy this code:
    Code:
    AuthType Basic
    AuthName "My Protected Area"
    AuthUserFile /usr/local/apache2/htdocs/.htpasswd
    Require valid-user
    Note: "/usr/local/apache2/htdocs/" can be any folder (however it's recommended you place it above your root http accessible directory for security purposes).


    3) Copy ".htaccess" into the directory you would like to protect. This can be your root folder (e.g. htdocs/) if you want to protect everything on your domain.


    4) Create a new file and name it ".htpasswd".


    5) Open up ".htpasswd" and copy this code:
    Code:
    guest14:GmbIGGkm23nTI
    "guest14" is the user name and "GmbIGGkm23nTI" is the encrypted password. In this case "access7289" is the unencrypted password. You can use free encryption tools such as this one to generate new passwords: http://tools.dynamicdrive.com/password/


    6) Copy ".htpasswd" into /usr/local/apache2/htdocs/ on your server (or whatever folder you directed your ".htaccess" file to check).


    You're done!
    Last edited by itsallkizza; 01-05-2010 at 04:42 PM.
    Feel free to e-mail me if I forget to respond ;)
    ohsosexybrit@gmail.com

  • Users who have thanked itsallkizza for this post:

    Doctor_Varney (01-08-2010)

  • #11
    New Coder
    Join Date
    Dec 2009
    Posts
    84
    Thanks
    6
    Thanked 3 Times in 3 Posts
    @ Doctor_Varney
    if you plan give your visitors access by yourself (manual) you can do it by .htaccess password
    but if you plan your visitor able to register 1st then open your (another) page you must be create / work with server side code and also database

    there are many options you can do:
    PHP (most famous then the others)
    with
    MYSQL /porgeSQL (as database)
    MYSQLlite (as database)
    CSV (as Database)
    Flatfile (as Database)

    if you are limited knowledge about coding and don't enough time to learn it more (or unsure) i suggest you using PHP + plaintext (for this i can help you freely if your project doesn't large.

  • #12
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    By short: either you learn how to do it, or you hire a professional.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #13
    New Coder
    Join Date
    Oct 2009
    Posts
    23
    Thanks
    0
    Thanked 1 Time in 1 Post
    Hello,

    Please visit the following sites to see if any of these can help you out:

    http://css-tricks.com/easily-passwor...-subdirectory/
    http://www.coffeecup.com/website-access-manager/
    http://www.2createawebsite.com/enhan...d-protect.html

    Hope these help!!!
    CoffeeCup.com

  • #14
    Regular Coder Doctor_Varney's Avatar
    Join Date
    Mar 2008
    Location
    Midlands, UK
    Posts
    649
    Thanks
    45
    Thanked 29 Times in 28 Posts
    Quote Originally Posted by Kor View Post
    password login? Use a server-side application and a DB.
    Yes, but WHAT server-side application?!

    Thanks for your help, but surely, I shouldn't need to hire a professional, just to set a password on a page.
    Last edited by Doctor_Varney; 01-08-2010 at 06:36 PM.

  • #15
    Regular Coder Doctor_Varney's Avatar
    Join Date
    Mar 2008
    Location
    Midlands, UK
    Posts
    649
    Thanks
    45
    Thanked 29 Times in 28 Posts
    Quote Originally Posted by itsallkizza View Post
    If you want it simple...


    1) Create a new file and name it ".htaccess" (you may need to create this directly on your server if you are using Windows for development because Windows requires a string before the extension).


    2) Open up ".htaccess" and copy this code:
    Code:
    AuthType Basic
    AuthName "My Protected Area"
    AuthUserFile /usr/local/apache2/htdocs/.htpasswd
    Require valid-user
    Note: "/usr/local/apache2/htdocs/" can be any folder (however it's recommended you place it above your root http accessible directory for security purposes).


    3) Copy ".htaccess" into the directory you would like to protect. This can be your root folder (e.g. htdocs/) if you want to protect everything on your domain.


    4) Create a new file and name it ".htpasswd".


    5) Open up ".htpasswd" and copy this code:
    Code:
    guest14:GmbIGGkm23nTI
    "guest14" is the user name and "GmbIGGkm23nTI" is the encrypted password. In this case "access7289" is the unencrypted password. You can use free encryption tools such as this one to generate new passwords: http://tools.dynamicdrive.com/password/


    6) Copy ".htpasswd" into /usr/local/apache2/htdocs/ on your server (or whatever folder you directed your ".htaccess" file to check).


    You're done!
    Many thanks, sir! That is a beautifully concise answer. At least I'll be able to try this.

    Most helpful... Have thanked you for you post, mate.

    Regards

    Dr. V


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •