I have done alot of web work in all sorts of languages but I have never used
the simple cookie. Question is
How does one set and retrieve a simple session cookie. All it will do is
have an image change on 1 page only with every new visitor, there are 5
images it should be random and stay the same unless the session is ended.
Sounds pretty simple but I cannot find simple examples of a cookie doing
anything similar to this. I found oodles of stuff on what a cookie is and
how it works but I could use an example, even if someone knows a website
that has simple clear examples, and to prove my ignorance what prog.
language are they written in. I have always used variables associated with a
db in asp but asp is not an option so it looks like html or JavaScript ????
Here is a simple image rotator but how would you set the cookie and check to
see if it is a new session for the rotator?
<SCRIPT LANGUAGE="JavaS cript">
image = new Array(3);
image[0] = 'images/bodymidrow1col2 .jpg'
image[1] = 'images/bodymidrow1col2 _2.jpg'
image[2] = 'images/bodymidrow1col2 _3.jpg'
index = Math.floor(Math .random() * image.length);
document.write( "<DL>\n");
document.write( "<IMG SRC="+image[index]+" height=120>");
</SCRIPT>
J
the simple cookie. Question is
How does one set and retrieve a simple session cookie. All it will do is
have an image change on 1 page only with every new visitor, there are 5
images it should be random and stay the same unless the session is ended.
Sounds pretty simple but I cannot find simple examples of a cookie doing
anything similar to this. I found oodles of stuff on what a cookie is and
how it works but I could use an example, even if someone knows a website
that has simple clear examples, and to prove my ignorance what prog.
language are they written in. I have always used variables associated with a
db in asp but asp is not an option so it looks like html or JavaScript ????
Here is a simple image rotator but how would you set the cookie and check to
see if it is a new session for the rotator?
<SCRIPT LANGUAGE="JavaS cript">
image = new Array(3);
image[0] = 'images/bodymidrow1col2 .jpg'
image[1] = 'images/bodymidrow1col2 _2.jpg'
image[2] = 'images/bodymidrow1col2 _3.jpg'
index = Math.floor(Math .random() * image.length);
document.write( "<DL>\n");
document.write( "<IMG SRC="+image[index]+" height=120>");
</SCRIPT>
J
Comment