login auth form

Questions about programming languages and debugging
Post Reply
User avatar
Still_Learning
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 1040
Joined: 11 Jun 2008, 16:00
15
Location: Trigger City

login auth form

Post by Still_Learning »

http://code.suck-o.com/117

how do i change the UN and PW to whatever i want? this is basic code i got from someone and when i change it from u1/p1, u2/p2 to say UN guest PW guest it does not work, any help is appriciated thanks
Gone

User avatar
maboroshi
Dr. Mab
Dr. Mab
Posts: 1624
Joined: 28 Aug 2005, 16:00
18

Looks to Me

Post by maboroshi »

Looks to me like it should work whats the error your recieving

User avatar
Still_Learning
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 1040
Joined: 11 Jun 2008, 16:00
15
Location: Trigger City

Post by Still_Learning »

its works.. but not how i would like

i tried to delete all except for u1 and p1 arrays, then changed u1 to say mylogin and p1 to say logmein and it would not accept the change and would not proceed to the next page. so its like im stuck useing u1 and p1 for a UN and PW. I guess i need a better understanding of how the page works in order to make the change I am wanting. thanks
Gone

ebrizzlez
Kage
Kage
Posts: 732
Joined: 31 Mar 2007, 16:00
17
Location: Hidden in a Buffer Protection.
Contact:

Post by ebrizzlez »

Replace the if statement with this:

Code: Select all

if (form.username.value == username[0] && form.password.value == password[0]) {
and all should be fine. :lol:

The username and password variables are an array of data, since your not using multiple usernames and passwords there would be no use of making it an array, you could just make it into a normal string or char statement instead.

But if you wish to still use the username as an array, remember in programming we count from 0.. 0,1,2,3. To access the first data in the array, we set it to 0. :wink:
[img]http://i81.photobucket.com/albums/j205/ebrizzlez/4lsint1.jpg[/img]

Post Reply