Well you would have a hidden form field
<input type="hidden" name="SomeName" id="someID" value=""/>
Then you would use javascript to set the value.
document.getElementById('someID').value = "Something here";
Then in PHP you would retrieve that after the page was submitted.
$someName = $_REQUEST['SomeName'];