Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Senior Member DesignBox's Avatar
    Join Date
    Apr 2004
    Posts
    340
    Member #
    5659
    I have a basic html page, and when i click on a link i want the user to put a username and password that is pre-defined in order to visit the specific page. How do i go about doing this?

  2.  

  3. #2
    Senior Member Holy Promethium's Avatar
    Join Date
    Jan 2005
    Location
    Scotland
    Posts
    157
    Member #
    8707
    It depends, some hosts allow you to have certain folders Password protected (such as f2g.net).

    The only way I know of password protecting something is via javascript, and that isnt exactly the safest method ever.

  4. #3
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    If you don't have access to a serverside script, then you can place the pages you need to password protect in a seperate folder, and add a .htaccess file in there.

    Any links that points to that folder, will generate a popup login window, where username and password has to match predefined values.

    If you can't use .htaccess, then there's little you can do beyond JavaScritp solutions. Those are quite unssecure.

    As the script works clientside, any username/password combination would be readable through "View Source", after loading the page.

    One idea is to have a special name on the files you try to hide, and use that name as a password.
    Ex. a protected page can be named 'Met34qxl.htm'. The password would be 'Met34qxl'.

    Of course, if people know the name of the page beforehand, they can just type in the name in the URL.
    Code:
      <form onsubmit="location.href = this.code.value + '.htm'; this.code.value=''; return false">
        <input type="password" size="10" name="code">
        <input type="SUBMIT" value="OK" onclick="location.href = this.form.code.value +  '.htm'; this.form.code.value='';  return false">
      </form>
    This type of security is of course extremely weak.

    ___________________

    There is a program called AtriseHTMLock, which basically makes a hash of all your html code. To access the hashed page, you have to enter predefined password. You can read about it here. That adds a bit more security than Javascript solutions.
    S. Rosland

  5. #4
    Senior Member DesignBox's Avatar
    Join Date
    Apr 2004
    Posts
    340
    Member #
    5659
    thanks guys, i'll check it out


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 04:31 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com