/    Sign up×
Community /Pin to ProfileBookmark

help with cookies (password/username)

I can’t figure out why it’s not working

here is what i have to do, and yes, i’ve browsed all the threads on this topic and know that js and cookies are not the way to password protect anything. 😉

i have to do a page where upon a users first entry, they have to enter a username and password that is then stored in a cookie. so the next time the come back, they have to re-enter the info and get 3 tries to get it right.

when correct, it goes to a WELCOME page, and if after 3 tries, they dont get it right… they go to the ERROR page.

here is where i’ve got the file
[url]http://www.geocities.com/lakepark84/test/cookie4.htm[/url]

(i had to take the method=post out of the code since for some reason, geocities doesnt allow it.)

it seems instead of validating, it just clears the fields and starts over again

(oh and i have that script editor that comes with Office, but for the life of me i can’t get it to work at home, when i can at school… so i really can’t see what is going on once it is running)

I’ve also made so many changes – that things that worked before, no longer do… so needless to say – i’m frustrated with this thing.

can someone take a peek and help me figure out what the heck i’m doing wrong.

Thanks in Advance

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliMar 10.2004 — I think you will find [url=http://www.webapplikations.com/pages/html_js/document/CompleteCookieUseage.html]this reaource usefull[/url]
Copy linkTweet thisAlerts:
@js_student66authorMar 11.2004 — I did see this one the other day (found it in another post) -- and honestly I'm not sure how to tweak it to fit my purpose.

I'll play around with it though.

One of my problems is to get that "three tries and your declined" part working.
Copy linkTweet thisAlerts:
@js_student66authorMar 14.2004 — I've been working on this quite a bit today and still can't get it just right.

The prompt boxes come up after i hit submit, not before

and i can't get the password to validate -- even when i know i'm entering it correctly, it tells me it's not valid.

I've re-saved this so many times that i lost the part where i get it right and the Welcome window to come up (get it to validate correctly), but now I only get the error window.

can someone take a peek to see where i went wrong?

Thanks in advance

(the link is in the first message in this post -- so i dont have to post all the code)
Copy linkTweet thisAlerts:
@js_student66authorMar 14.2004 — well, i'm still working on this (seems more time than need be) but now i dont get the prompt boxes at all and what ever my input is - i get "You've entered the correct username/password" and the welcome window pops up, but the user name is "undefined"

here's the link:

http://www.geocities.com/lakepark84/test/my_cookie1.htm

Thanks to anyone who replies
×

Success!

Help @js_student66 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...