PDA

View Full Version : help with script please



johnmott
10-29-2011, 02:49 PM
1) Script Title: Encrypted Password script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex9/password.htm

3) Describe problem: hi, im using an encrypted password script, it works fine and forwards to urls on submit, however on 3 of the for user passcodes as well as forwarding to the url the alert box appears!. Secondly i want the results to open in a new window, any help will be appreciated, ive put the 4 passcodes below, the urls are tests and the script is below.

passcodes;

14623

24862

36712

45213


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

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


<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()

passcode = 1
for(i = 0; i < password.length; i++) {
passcode *= password.charCodeAt(i);
}

//CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
if(passcode==350859600)
//CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
{
window.location="http://www.hotmail.com"}

//CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
if(passcode==393120000)
//CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
{
window.location="http://www.yahoo.com"}

//CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
if(passcode==371101500)
//CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
{
window.location="http://www.ebay.co.uk"}

//CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
if(passcode==344362200)
//CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
{
window.location="http://www.google.co.uk"}

else{
alert("wrong try again.")}
}
</script>

<form name="password1">

<input type="password" name="password2" size="15">

<input type="button" value="Search" onClick="submitentry()">
</form>

jscheuer1
10-29-2011, 04:39 PM
I'm not sure if you know this or not, but this is not very secure. Anyone can look at the source code and see the links and navigate directly to them.


However, to make the script work, get rid of the highlighted and change the red:


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

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


<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()

passcode = 1
for(i = 0; i < password.length; i++) {
passcode *= password.charCodeAt(i);
}

//CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
if(passcode==350859600)
//CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
{
open("http://www.hotmail.com", "_new");}

//CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
else if(passcode==393120000)
//CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
{
open("http://www.yahoo.com", "_new");}

//CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
else if(passcode==371101500)
//CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
{
open("http://www.ebay.co.uk", "_new");}

//CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
else if(passcode==344362200)
//CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
{
open("http://www.google.co.uk", "_new");}

else{
alert("wrong try again.")}
}
</script>

<form name="password1">

<input type="password" name="password2" size="15">

<input type="button" value="Search" onClick="submitentry()">
</form>