I'm a newbie, so I probably don't know what I'm talking about, but I think I may have the answer. What you do is using JavaScript, you pass a variable to a hidden input. I know it sounds dumb, but I used this technique on my website, except for that the input wasn't hidden.
Here's a simple example that you may be able to apply to your website. I put 'blah' for a lot of things because I am unoriginal.
First page -
<html>
<head><title>Blah!</title>
<script language="JavaScript">
<!--
var a = "blah";
function bloo () {
window.document.blahform.blahfield.value = a;
}
//-->
</script>
</head>
<body onLoad="bloo ()">
<form name="blahform" action="blahfun.php" method="post">
<input name="blahfield" type="hidden">
<input type="submit" value="Submit">
</form>
</body>
</html>
Second page-
<html>
<head><title>More blahs!</title></head>
<body>
<?php
print ("$blahfield");
//outputs blah, the value of var a in the JavaScript page
?>
</body>
</html>
I hope that this helps!