Connecting Tech Pros Worldwide Help | Site Map

a little problem

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 20th, 2005, 11:23 AM
Sander de Maaijer
Guest
 
Posts: n/a
Default a little problem

hello
i hav a little problem this is a script calles secret word when you type the
secret word you get a alert whit the text:"and this is the text of the alert
wehn you know the word"
butt i want not a alert but a forwarding to a other site can anybody help
me ?
and sorry my english is NOT good

thnx sander

<html>

<head>
<title>secret word</title>
<script language="JavaScript">
var nav=navigator.appName;
var ns=(nav.indexOf("Netscape")!=-1);

if(ns){
if(document.layers){
document.captureEvents(Event.KEYPRESS);
document.onkeypress = cheat;
}
if(document.getElementById){
document.onkeypress = cheat;
}
}
else
{document.onkeypress = cheat;}

var SpecialWord = "secret";//thist is the secret word
var SpecialLetter = 0;
var vcheat = false
function cheat(keyStroke)
{
var eventChooser = (ns)?keyStroke.which: event.keyCode;
var which = String.fromCharCode(eventChooser).toLowerCase();
if(which == SpecialWord.charAt(SpecialLetter)){
SpecialLetter++;
if (SpecialLetter == SpecialWord.length) alert("and this is the text of
the alert when you know the word")
}
else {SpecialLetter = 0;vcheat = false}

}
</script>
</head>

<body>
</body>

</html>



  #2  
Old July 20th, 2005, 11:24 AM
Stuart Palmer
Guest
 
Posts: n/a
Default Re: a little problem

try doing a document.location="url_to_new_site"; instead of the alert.

I would suggest that JS password validation is useless too as if a browser
can read the password, a user can also get the password by viwing source,
there are pasword encoders, but also decoders for these passwords. Best to
do the validation serverside.

Anyways, hope that helps

Stu



"Sander de Maaijer" <sander.de.maaijer@hccnet.nl> wrote in message
news:bnjshg$s3s$1@news.hccnet.nl...[color=blue]
> hello
> i hav a little problem this is a script calles secret word when you type[/color]
the[color=blue]
> secret word you get a alert whit the text:"and this is the text of the[/color]
alert[color=blue]
> wehn you know the word"
> butt i want not a alert but a forwarding to a other site can anybody help
> me ?
> and sorry my english is NOT good
>
> thnx sander
>
> <html>
>
> <head>
> <title>secret word</title>
> <script language="JavaScript">
> var nav=navigator.appName;
> var ns=(nav.indexOf("Netscape")!=-1);
>
> if(ns){
> if(document.layers){
> document.captureEvents(Event.KEYPRESS);
> document.onkeypress = cheat;
> }
> if(document.getElementById){
> document.onkeypress = cheat;
> }
> }
> else
> {document.onkeypress = cheat;}
>
> var SpecialWord = "secret";//thist is the secret word
> var SpecialLetter = 0;
> var vcheat = false
> function cheat(keyStroke)
> {
> var eventChooser = (ns)?keyStroke.which: event.keyCode;
> var which = String.fromCharCode(eventChooser).toLowerCase();
> if(which == SpecialWord.charAt(SpecialLetter)){
> SpecialLetter++;
> if (SpecialLetter == SpecialWord.length) alert("and this is the text of
> the alert when you know the word")
> }
> else {SpecialLetter = 0;vcheat = false}
>
> }
> </script>
> </head>
>
> <body>
> </body>
>
> </html>
>
>[/color]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.