Terry A. Haimann said:
I want to pass a variable from one page(in javascript) to a second page(in
php,) what is the syntax in both lanuages to do such?
Thx in advance, Terry
Hi,
Put the values in hidden inputs on a form and post it to your php page.
The posted inputs will be available in php as variables.
<form action="myFile.php" method="post" name="myForm">
<input type="hidden" name="myVar" value="">
</form>
<script type="text/javascript">
document.forms["myForm"].elements["myVar"].value="Hello world"
document.forms["myForm"].submit()
<script>
------------------------
myFile.php:
echo "Received value: ".$myVar ;
hth Fred