Results 1 to 3 of 3

Thread: Javascript password to protect website

  1. #1
    Join Date
    Dec 2008
    Posts
    371

    Javascript password to protect website

    hi,
    i am looking for simple Javascript password to protect my web page one can't see the password in the plain language in the source text.
    does someone have a version where that is perhaps coded?Any recommendations and suggestions are appreciated.

  2. #2
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Javascript password to protect website

    with the following version the password = is the file name on is passed on…
    the Script looks as follows:
    Code:
    <script language= " Javascript " >
    <! -- 
    function Passw () 
    { 
    var passwords = “please enter you here your password!” 
    password=prompt (“This AREA is passwords protected. Please more enter my  name or password: ”, ''); 
    location.href=password + “.html”; 
    } 
    //-- > 
    </script>

    and becomes in such a way:

    Code:
    <a href= " Javascript: Passw () “>Link to the secret Datei</a>
    if the password thus “laserpointer” is must the target file with the secret data laserpointer.html

  3. #3
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Javascript password to protect website

    f your password is "lazysnake", create a file called lazysnake.html on your web site. As long as you don't link to lazysnake.html from any of your public documents, no one will be able to find it (not even the search engines)! There is generally no index of documents available for a whole web site. If you don't tell someone where you keep your protected file, they won't be able to access it.

    Code:
    <HTML>
    <SCRIPT language="JavaScript"><!--
    function check() {
        // Prompt user for the password ...
        pwd = prompt('Enter password before continuing','');
        // ... then set the browser location. (change the line below this one!)
        location.href = 'http://www.changethis.com/~you/' + escape(pwd) + '.html';
    }
    // -->
    </SCRIPT>
    <HEAD>
    <TITLE>Site Entrance</TITLE>
    </HEAD>
    <BODY>
    <DIV align="center">You must have a password to enter this site!<P>
        <FORM>
            <INPUT type="Button" onClick="check()" value="Enter Site">
        </FORM>
    </DIV>
    </BODY>
    </HTML>

Similar Threads

  1. How to protect password?
    By Otilio in forum Windows Software
    Replies: 3
    Last Post: 21-11-2009, 05:12 PM
  2. Protect files from download from website
    By Quattro in forum Software Development
    Replies: 3
    Last Post: 06-11-2009, 10:41 AM
  3. How to edit any website javascript with Firefox
    By Zariah in forum Software Development
    Replies: 3
    Last Post: 12-08-2009, 05:33 PM
  4. How can i password protect my website
    By Madison in forum Software Development
    Replies: 3
    Last Post: 28-07-2009, 11:01 PM
  5. Do google understand javascript code in my HTML website?
    By Sid-O in forum Software Development
    Replies: 3
    Last Post: 22-07-2009, 07:45 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,750,252,802.48435 seconds with 16 queries