I'm trying to use cookies for, amazingly, the first time. I need to store a value from a displayed page into a cookie, then retrieve it within the PHP script named in the "action=" attribute of the FORM within the page containing the JavaScript that creates the cookie. The JS code is....
[code=php]document.cookie = 'cookie_elapsed=elapsed'[/code]
to create the cookie. The variable "elapsed" actually contains a number value, which I verified using an alert() popup.
The PHP to get the value is...
$timer_var = $_COOKIE['cookie_elapsed'];
print "TIMER_VAR '$timer_var'<br>";
What I get is simply "elapsed" (or whatever string I put in the document.cookie assigment). So, in other words, I need the VALUE of the variable "elapsed" stored in a cookie called "cookie_elapsed", but what I'm getting is just the name of the variable "elapsed".
Must be pretty basic, but I can't get past it...the examples I find seem to be saying to do exactly what I'm doing....help???
Thanks!