/    Sign up×
Community /Pin to ProfileBookmark

Hi. I have catch an loginscript from javascript.nu. This one works excellent. It works like this: when you write in name/pas, you acctualy typing what file that should be opened.

eg. whant to login to “index123.htm”:
name: index
pas: 123

What I now whant is: if you typing a file that NOT excist, it should get you to an site and not to “the site could not been found”. And even bether would it be if a pop-up window came and told “wrong pas!”.

the script looks like this:

[code=html]
<html> <head> <SCRIPT LANGUAGE=”JavaScript”…
<html>
<head>
<SCRIPT LANGUAGE=”JavaScript”>
<!–
defaultStatus=(“”);
//–>
</SCRIPT>

<SCRIPT LANGUAGE=”javascript”>
<!–This is one of many scripts which are available at: *—
//–http://www.JavaScript.nu/javascript *—
//–This script is FREE, but you MUST let these lines *—
//–remain if you use this script. *—

//***—Filändelsen på filen man ska komma till. Kan vara t.ex. “htm” eller “html”.
filandelse=”htm”

function password()
{
if ((document.pass.word.value != “”) && (document.pass.namn.value != “”))
{
sida=document.pass.namn.value+document.pass.word.value+”.”+f
ilandelse
parent.location=sida.toLowerCase()
document.pass.word.value=(“”);
}
}
//–>
</SCRIPT>
</head>

<body>
<FORM METHOD=”post” NAME=”pass” ACTION=”javascript:password();”>
<B><font class=”InputText2″>Namn:</font></B><BR>
<INPUT TYPE=”text” class=”InputText” NAME=”namn”></td></tr><tr><td>
<B><font class=”InputText2″>Lösenord:</font></B><BR
><INPUT TYPE=”password” class=”InputText” NAME=”word”></td></tr><tr><td>
<a href=”link.htm” target=”links”><INPUT TYPE=”button” class=”InputText2″ NAME=”knapp” VALUE=”Logga in” onClick=”password();”></a>
</FORM>
</body>
</html>
[/code]

I really hope it can be worked out with javascript becouse I dont got .php supported.

edit: I have tried to find help in many forums and I guess you are my only hope left. At least give feedback if it´s even possible to do like this…

You can also watch it at me swedish site: [url=www.wings.info.se]www.wings.info.se[/url]

//Hunter

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@MongusJun 23.2005 — You could XOR all of the letters together then make sure the result matched your valid page's number. You'll get a 1 in 256 chance of your user typing in a combo that came out to the correct value but wasn't the right page.

I'd probably XOR all of the characters at even positions into one number and all of the characters in odd positions into another number. Then you get 2^16 possibilities or 1 in 65,536 chance of the user typing in a combination that matched the number but wasn't right.
Copy linkTweet thisAlerts:
@Hunter_wowauthorJun 23.2005 — I sound like it can work then. Only problem is that I´m no good at scripting. Would be GREAT if you could specify it in script format.
Copy linkTweet thisAlerts:
@Alon_C_Jun 23.2005 — Hello Hunter Wow,

Hereby the script to be added:

====START=====

<html>

<head>

<SCRIPT LANGUAGE="JavaScript">

<!--

defaultStatus=("");

//-->

</SCRIPT>

<SCRIPT LANGUAGE="javascript">

<!--

Fextension="htm"

function password()

{

if ((document.pass.word.value != "") && (document.pass.namn.value != ""))

{

sida=document.pass.namn.value+document.pass.word.value+"."+Fextension

if(Verify()==-1){document.pass.word.value=""; document.pass.word.focus(); } else

parent.location=sida.toLowerCase()

document.pass.word.value=("");

}

}

//-->

</SCRIPT>

<SCRIPT LANGUAGE="JavaScript">

<!--

function Verify(){

var1 = document.pass.word.value;

var2 = "al"; // Note: password must include the "al" letters

// (You can change this to any other combination [e.g., jx2b] )

if (var1.search(var2) > -1) {

return 0;

} else {alert("Illegal Password - Try Again.."); return -1 }

}

// -->

</SCRIPT>

</head>

=====END=========

Regards!

Alon.
Copy linkTweet thisAlerts:
@Hunter_wowauthorJun 23.2005 — DAM! I cant expalin in words how greafull I am. Love you and this wounderfull site. Thanks a LOT!!!
Copy linkTweet thisAlerts:
@A1ien51Jun 24.2005 — Here is a way to use AJAX with JavaScript to validate to see if a link is valid or not. Basically you can take your idea of username and password to make the page.

http://radio.javaranch.com/pascarello/2005/06/24/1119626686861.html

Eric
×

Success!

Help @Hunter_wow spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...