Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 03-03-2009
Member
 
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.
Reply With Quote
  #2  
Old 03-03-2009
Member
 
Join Date: Apr 2008
Posts: 2,001
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
Reply With Quote
  #3  
Old 03-03-2009
Member
 
Join Date: Oct 2005
Posts: 2,389
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>
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Javascript password to protect website"
Thread Thread Starter Forum Replies Last Post
How to protect password? Otilio Windows Software 3 21-11-2009 05:12 PM
Protect files from download from website Quattro Software Development 3 06-11-2009 10:41 AM
How to edit any website javascript with Firefox Zariah Software Development 3 12-08-2009 05:33 PM
How can i password protect my website Madison Software Development 3 28-07-2009 11:01 PM
Do google understand javascript code in my HTML website? Sid-O Software Development 3 22-07-2009 07:45 PM


All times are GMT +5.5. The time now is 05:37 PM.