| Forums > Tips & Tricks > "How to set password using javascript?" (2 replies)
|
 |
Author: L|nG
Posted: 2.2 years ago
(link)
|
|
Hi,
i went to visit some site and i notice that some of the site only allow certain people with password to access.
Anyone know how to do that? pls advice.
Thanks alot. =)
|
| |
|
| |
|
| |
(script language="JavaScript"
(!--hide
var password;
var pass1="PASSWORD HERE";
password=prompt('PW PROMPT');
if (password==pass1)
alert('ALERT WHEN YOU GET THE PW CORRECT');
else
{
window.location="WEB TO GO TO WHEN THE PW IS WRONG";
}
//--)
(/script)
change the ( and ) at the top and bottom of the script to
use this. (:
code gotten from my friend at http://myy-storriex.blogspot.com
|
| |
| |
|
| |
actually.. it is able to work.. bt.. the new windows internet explorer cannot view the pop up scripted which tat popup is the input value of the user.
i found this too..
[script]
alert("the password is enter"
//we will frirst ask the user if he wold like to countinue into this restricted area
var p=confirm("this site is pass word protected,do you still want to enter?"
if(p){
var ans="enter"
var pass=prompt("what is the pass word"
if(pass!==ans)
{
alert("wrong you will now be transfered"
window.location="http://yahoo.com"
}else{alert("correct" ;}
}else{window.location="http://yahoo.com"}
[/script]
|
| Subscribe To This Thread: RSS 2.0 or Atom (?) |
| This thread has been locked, and no new replies can be posted. |