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
login auth form
- Still_Learning
- Fame ! Where are the chicks?!
- Posts: 1040
- Joined: 11 Jun 2008, 16:00
- 15
- Location: Trigger City
login auth form
Gone
Looks to Me
Looks to me like it should work whats the error your recieving
- Still_Learning
- Fame ! Where are the chicks?!
- Posts: 1040
- Joined: 11 Jun 2008, 16:00
- 15
- Location: Trigger City
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
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
-
- Kage
- Posts: 732
- Joined: 31 Mar 2007, 16:00
- 17
- Location: Hidden in a Buffer Protection.
- Contact:
Replace the if statement with this:
and all should be fine.
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.
Code: Select all
if (form.username.value == username[0] && form.password.value == password[0]) {
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.
[img]http://i81.photobucket.com/albums/j205/ebrizzlez/4lsint1.jpg[/img]