PDA

View Full Version : Password script problem!



sunny
05-31-2005, 05:21 AM
I am getting the problem saying "http" is not a registered protocol
while using th following script:
http://www.dynamicdrive.com/dynamicindex9/password.htm
what should i do to use it on the net.
Thanks

jscheuer1
05-31-2005, 06:49 AM
Are you using PHP or ASP?

sunny
05-31-2005, 10:53 PM
No,
What i want to say is that, i want to password protect my page(trying as example)
http://www.angelfire.com/empire2/funnyland/thankyou.html
(window.location=password+"http://angelfire.com/empire2/funnyland/thankyou.html")
the script is at another site.
and the password is 'silas' but as i enter the password, there is a prompt saying:
'silashhtp' no a registered protocol .
I think that, the script is not meant for entering full url.And will only work wth
*.html.
And the password should be as such that it should be a name of my destination page(thankyou.html) in this case my password should be thankyou.
Is it Right ?

jscheuer1
06-01-2005, 04:47 AM
Very close, try this if you are still having trouble:
window.location="http://angelfire.com/empire2/funnyland/"+password+"thankyou.html"and then the name of the page should be (using the password in your post):

silasthankyou.html

sunny
06-02-2005, 06:37 AM
I did as you said but all in vain.
my script is at:
http://www.angelfire.com/empire2/funnyland/password.html
password.html is the name of the file.
I have renamed the file as silasthankyou.html.but now as i enter the password ,
the browser takes me no where & drops me in to the same page after re-loading with the address:
http://www.angelfire.com/empire2/funnyland/password.html?password2=silas
I even forgot to tell you that i had modified the script and removed the username option from the script
the script looks like this :


<html>
<body>
<script>
//Encrypted Password script- By Rob Heslop
//Script featured on Dynamic Drive
//Visit http://www.dynamicdrive.com
//http://www.dynamicdrive.com/dynamicindex9/password.htm
function submitentry(){
password = document.password1.password2.value.toLowerCase()
//username = document.password1.username2.value.toLowerCase()
passcode = 1
//usercode = 1
for(i = 0; i < password.length; i++) {
passcode *= password.charCodeAt(i);
}
/*for(x = 0; x < username.length; x++) {
usercode *= username.charCodeAt(x);
}*/
//CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
if(passcode==14547235500)
//CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
{
window.location="http://angelfire.com/empire2/funnyland/"+password+"thankyou.html"
else{
alert("Password is Incorrect")}
}
</script>

<form name="password1">
<strong>Enter password: </strong>
<input type="password" name="password2" size="15">

<input type="button" value="Submit" onClick="submitentry()">
</form>
</body>
</html>

Do also tell me whether the form name "password1" and the input name"password2" can create any problem.

jscheuer1
06-02-2005, 08:20 AM
Not sure what the problem was but, here is one solution:


<script>
//Encrypted Password script- By Rob Heslop
//Script featured on Dynamic Drive
//Visit http://www.dynamicdrive.com

function submitentry(){
password = document.password1.password2.value.toLowerCase()
username = document.password1.username2.value.toLowerCase()
passcode = 1
usercode = 1
for(i = 0; i < password.length; i++) {
passcode *= password.charCodeAt(i);
}
for(x = 0; x < username.length; x++) {
usercode *= username.charCodeAt(x);
}
//CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
if(usercode==134603040&&passcode==14547235500)
//CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
{
window.location="http://angelfire.com/empire2/funnyland/"+password+"thankyou.html"
}
else{
alert("Invalid Password!")}
}
</script>

<form name="password1">
<input type="hidden" value="john" name="username2">
<strong>Enter password: </strong>
<input type="password" name="password2" size="15">
<input type="button" value="Submit" onClick="submitentry()">
</form>Works here.

sunny
06-04-2005, 08:20 AM
Not working yet.
By the way thanks for replying .I'll try somme other password scripts.
THANKS