few solution is available. but the simplest one would be as below example:
function forward()
{
var a=100;
var b=200;
document.location="target_php_file.php?a="+a+"&b="+b;
}
now, call this so called function.
and in php use $_GET array to access the data.
as i told you can also do other trick to send the data. you can send as AJAX request as Sandeep Mewara says, you can also create hidden form with hidden object and then commit submit function on the form. well pick your solution