terzdance
12-18-2003, 07:47 PM
Help me please! I am VERY new to javascript.
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 name is. 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
Homepage (http://istreamcast.com/powerportals/general)
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 :o
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 name is. 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
Homepage (http://istreamcast.com/powerportals/general)
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 :o
THANKS!! XOXO
terzdance