you'd use both php and javascript. it's simply a matter of echoing the php values into the javascript. Let's say you have the following function
<script language="Javascript">
function newWin(url, wx, wy) {
window.open(url, '', "width=" + wx + ",height=" + wy);
}
</script>
You'd call it using
newWin('page.php', '<?= ($width + 50) ?>', '<?= ($height + 50) ?>');
where $width is the width and $height is the height.
Cgraz