Results 1 to 2 of 2
Thread: Javascript - Password Arrays
- 11-23-2007, 10:59 AM #1
Member
- Join Date
- Nov 2007
- Posts
- 3
- Rep Power
- 0
Javascript - Password Arrays
Hi,
I am currently creating a password option for my website.
So far I have about 5 people (hey its a start!! They're mates!!)
I have those five passwords in an array called userPasswords.
I have a 'userenterPassword = window.prompt('Please enter password.','');' set up to keep the password in memory.
I have a var UserIndex = 1;
Then I try to set up a for loop:
for(count = 0; count < userPasswords[UserIndex]; count = count + 1)
{
if(userenterPassword != userPasswords)
{
'userenterPassword = window.prompt('Please enter password.','');
}
};
It wont seem to go further this?
Should I be using a WHILE loop for user password wrong entry?
Please 'elp!
Thanks
- 11-23-2007, 11:47 PM #2
Member
- Join Date
- Nov 2007
- Posts
- 8
- Rep Power
- 0
I would use a while loop rather than an IF inside a FOR Loop.
If your using passwords as a login to a website, i would use a database to store the details then use PhP to check the username & password against the database rather than just use an array within the website.
This is my personal preference, although it is pretty easy to update the data and moify it when using the database.
Similar Threads
-
Javascript Alert
By mutuah in forum New To JavaReplies: 4Last Post: 03-25-2010, 06:28 PM -
Javascript into Excel
By gdj100 in forum Advanced JavaReplies: 0Last Post: 03-12-2008, 12:03 PM -
please help with javascript code!!!!
By sahkab in forum New To JavaReplies: 1Last Post: 11-26-2007, 04:20 PM -
Jsp and javascript
By Ed in forum JavaServer Pages (JSP) and JSTLReplies: 2Last Post: 07-04-2007, 05:54 AM -
javascript validation
By yuchuang in forum New To JavaReplies: 5Last Post: 05-14-2007, 04:38 PM
Bookmarks