Important alert: (current site time 7/15/2013 1:22:43 PM EDT)
 

VB icon

_ Punish users for entering wrong password_ (careful) _

Email
Submitted on: 12/6/2000 6:18:59 PM
By: paul_cormie 
Level: Intermediate
User Rating: By 6 Users
Compatibility: JavaScript
Views: 34296
(About the author)
 
     
The ultimate punishment for entering a wrong password.

A simple password prompt asks to enter a password, and its even on the alert box, so don't screw it up the first time.
Now enter the wrong password!

Basically how it works, is you get four attempts (customizable) to enter a valid password (also customizable).If you get it right, then it directs you to a web site ( i set it to PSC ), but...if you get it wrong, it opens a set URL (customizable) for as long as you have the first main window opened.

Two things, if you know now to close the main password prompt window, i doubt you will loose any information (as in crashing applications), and it keeps opening the new windows until either the systems locks up (uses 100% of the CPU) or the window is closed.




 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
'**************************************
' Name: _ Punish users for entering wrong password_ (careful) _
' Description:<br><b>The ultimate punishment for entering a wrong password.</b><br><br>
A simple password prompt asks to enter a password, and its even on the alert box, so don't screw it up the first time. <br>Now enter the wrong password!<br><br>
Basically how it works, is you get four attempts (customizable) to enter a valid password (also customizable).If you get it right, then it directs you to a web site ( i set it to PSC ), but...if you get it wrong, it opens a set URL (customizable) for as long as you have the first main window opened. <br><br>
Two things, if you know now to close the main password prompt window, i doubt you will loose any information (as in crashing applications), and it keeps opening the new windows until either the systems locks up (uses 100% of the CPU) or the window is closed.<br><br><br>
' By: paul_cormie
'
' Inputs:the URL you want to go to when you get the password right, URL for wrong, number of tries, the actual password, and you can customize the alert boxes and password box. I found a similar idea to this on the web, but this one is slightly different.
'
' Returns:try it to see!
'
' Assumes:none...all the HTML is here so its a no brainer cut and paste. Just cut it, try it, know that you are warned about the incorrect password route, and enjoy!
'
' Side Effects:100% CPU useage until you close the main password window
'
'This code is copyrighted and has' limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=2016&lngWId=14'for details.'**************************************

<html>
<head>
<title>HOPE YOU SAVED YOUR FILES!</title>
</head>
<script language="JavaScript">
<!--
var password = "password";
var passed = "http://www.planetsourcecode.com";
var attempts = 4;
var crash_trigger = 0;
while (crash_trigger < attempts) {
	var password_prompt = prompt("Enter a 'password' to proceed. ( hint, hint... ) Use at own risk!","");
		if (password_prompt == null) crash_trigger++;
 		 else {
				if (password_prompt.toLowerCase() == password) {
				alert("Good thing you got it right!\nTry it again and put the wrong password in!\n\n\n\nbut be sure to close and save you other application and documents! \n");
				location = passed;
				break;
				}
		else crash_trigger++;
			}
}
if (crash_trigger == attempts) {
	while(true) window.open("http://www.a_valid_domain.com");
}
//-->
</script>
<body>
use at own risk
</body>
</html>


Other 7 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

12/29/2000 1:11:25 PMpaul_cormie

just for fun
(If this comment was disrespectful, please report it.)

 
3/13/2002 5:14:28 PMJohn McDonald

Ya know, An even better thing you could do is instead of opening "http://www.a_valid_domain.com" open up an other web page that is opening itself. 1,2,4,8,16,32,... More reliable. Then they have to close every single last one before it stops, not just one. Just a tip
(If this comment was disrespectful, please report it.)

 
4/16/2002 10:59:14 PMJoe Burman

Good Idea Paul
(If this comment was disrespectful, please report it.)

 
6/17/2002 1:46:48 PMsean

If you've got windows xp and
(If this comment was disrespectful, please report it.)

 
3/17/2003 1:05:43 PM

So sorry boys, but this code isn't very safe, but it's cool and will keep away some people...
I'm not good at javascript so I can't do it, but it would be alot more secure if you closed the original window before or after it had opened all those new windows!
In this way people can read your codes an the easily get the password! If you closed your window just after then they wouldn't get the password so quickly, but it would still be easy to get it!

So use this for fun, not for safety!
(If this comment was disrespectful, please report it.)

 
9/6/2003 11:21:19 PM

lol i left and the pop ups hit like a nuclear bomb lol thats sweet
(If this comment was disrespectful, please report it.)

 
11/17/2003 2:09:29 AM

_ Punish users for entering wrong password_ (careful) _

(If this comment was disrespectful, please report it.)

 
11/17/2003 2:13:01 AM

Ya know, An even better thing you could
do is instead of opening
"http://www.a_valid_domain.com" open up
an other web page that is opening
itself. 1,2,4,8,16,32,... More
reliable. Then they have to close every
single last one before it stops, not
just one. Just a tip

(If this comment was disrespectful, please report it.)

 
1/27/2004 5:11:41 PMNick Campbell

This code is just dumb...why are you going to open a window if someone types a wrong password...
firstly, the password is plaintext in the source code, second the fact that a person could screw up their password is quite possible. This code will just kill a person's attempt to log in. This code is basically useless and so is most stuff javascript if you are atempting to password protect...

Look elsewhere, like server-side, password checking if you are looking for security. Punishing users for screwing up a password is just dumb... IMHO
(If this comment was disrespectful, please report it.)

 
1/27/2004 5:13:22 PMNick Campbell

BTW, i mean no disrespect by my comment, i just don't agree that it's a great script to use for users...It is certainly a deterant, but there are other methods...That was my basic point
(If this comment was disrespectful, please report it.)

 
7/9/2004 5:27:47 AM

This code works, but is just not secure. I wont use it for security purposes if i were you
(If this comment was disrespectful, please report it.)

 
7/16/2004 11:22:00 PM END

OooOO I luv it ^_^ just what i need for my site www.xendz.computed.net
(If this comment was disrespectful, please report it.)

 
6/7/2007 12:06:15 AMRayan D.

Yeah it's not safe but it's fun! Man, 58 windows before i even knew what hit me
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.