I have a script to count down the time from a future date.
I generate the date in PHP and pass it as a variable to the script.
I have thought of creating a new java variable and using that, but I keep hitting the same problem.
Here is a sample of the script:
//The next line is the target countdown value
//It is based on LOCAL TIME to the countdown value
targettime = new Date("July 16 2004 0:00:01");
It is the target date in "" that is causing the issue.
I want to replace it with <?php echo $variable; ?> eg.
targettime = new Date("<?php echo $variable; ?>");
the variable is generated in PHP at the beginning of the page.
The variable does appear to put the variable value in (as viewed in source code from browser page), and even between the "", however, the script stops and does not behave as the original.
Is there some way to create a new java variable from the PHP variable and then substitute the date for this new variable.
Incidently, the script does not work without the date being surrounded by "".
Being a complete novice with java I appologies if this is dead simple and you all laugh at me!