i use to do it in the following way (it is not a very clean solution, but it was the only way i could think of solve the problem):
you can make a reload or a redirection to a special file, using document.location.href="somepage.php". And if you want to pass php-Vars, you can do it in "GET-Mode":
<script type="text/javascript">
document.location.href="somepage.php?var1=<?echo $var1;?>&var2=<?echo $var2;?>";
</script>
That should pass the values of var1 and var2 to the file somepage.php.
Another way of passing the vars is to set hidden inputs to values and then send the form, using javascript. (eg: dosument.forms[0].submit()😉
hope that i could help a bit
ali