Help me please! I am VERY new to javascript, but this looks like a great forum and I hope one of you knowledgable programmers will have the patience to look at my code and help me out.
I need a cookie to do the following:
-User clicks on a link (example: "Music" on the homepage
-Is taken to music/index.html, which looks for a cookie.
-If said cookie is not found, displays a form to get the username (not a script prompt)
-on submit, takes user to music/music.html and shows a welcome message (i.e. Welcome Username!)
-Next time user clicks on the same link, the cookie is detected and goes directly to music/music.html
This also needs to work with the same cookie for other pages (i.e. the entertainment link is clicked and user is taken to entertainment/index.html which looks for the username cookie and either dispays itself (with the form to be filled out) or re-directs to entertainment/entertainment.html if the cookie is found.
So far, (i think??) each form is setting a separate cookie and doesnt know to look for the other cookie. I assume they should all have the same name and value, but am not even exactly sure what or where the existing cookie(s) name(s) is/are. Here is what I have so far... I know it's a mess! Any help would be greatly appreciated, as i am attempting to use scripts i've found and paste them together
Click on "MUSIC" and "ENTERTAINMENT" in the Header. Ignore all the other fields in the form except the Name field. They don't do anything
THANKS!! XOXO
terzdance
I need a cookie to do the following:
-User clicks on a link (example: "Music" on the homepage
-Is taken to music/index.html, which looks for a cookie.
-If said cookie is not found, displays a form to get the username (not a script prompt)
-on submit, takes user to music/music.html and shows a welcome message (i.e. Welcome Username!)
-Next time user clicks on the same link, the cookie is detected and goes directly to music/music.html
This also needs to work with the same cookie for other pages (i.e. the entertainment link is clicked and user is taken to entertainment/index.html which looks for the username cookie and either dispays itself (with the form to be filled out) or re-directs to entertainment/entertainment.html if the cookie is found.
So far, (i think??) each form is setting a separate cookie and doesnt know to look for the other cookie. I assume they should all have the same name and value, but am not even exactly sure what or where the existing cookie(s) name(s) is/are. Here is what I have so far... I know it's a mess! Any help would be greatly appreciated, as i am attempting to use scripts i've found and paste them together
Click on "MUSIC" and "ENTERTAINMENT" in the Header. Ignore all the other fields in the form except the Name field. They don't do anything
THANKS!! XOXO
terzdance