PDA

View Full Version : using cookies to pass information between pages


cat_evilness
11-21-2002, 06:34 PM
Okay guys, I'm trying to make a virtual pet and here's what I have so far: http://www.angelfire.com/games4/virtualpet/main.html

I have 3 different pages going together to make up the main site. Now I need to program it so that when the user pushes a button say Feed then 1 will be added to the variable hunger. The variables are made up from counters that count down from 10 to 1 and I need to have it so that it just adds 1 onto the counter.

If anyone can give me code that will do this or has any idea how to help please give me a shout. I think you can do this using cookies.

Thankyou.
Cat

BrightNail
11-21-2002, 06:51 PM
there are a couple of ways to do this..

1. put your variables in an invisible frame and just pass the updates to them from the main frame..and reference that invisible frame when you need them.

2. pass the variables in name/value pairs thru the url string and just retrieve them and pass them on to subsequent pages...

3. and cookies.

cat_evilness
11-21-2002, 06:56 PM
thanks, i have absolutely no idea how to go about doing that. I would know how to program this in a language like Basic but I have no idea of how to in Javascript. Do you have any idea where I could get the code to do this from.

Thanks for your help I really really need it....
Cat :confused: