Hi,
you could fill a hidden input type with a value and then call a js function to grab it the page.
Exaple:
......
<form name="test">
<input type="hidden" name="test" value="<? echo $yourPhpVarValue ;?>">
</form>
......
And then the function to "alert the value":
<script type="text/javascript">
alert(document.test.test.value);
</script>
I did not test in on my box so there could be typos, but
theoretically it should work ....
regards ali