From the code you have posted so far, there is no requirement for the HTML to be written via PHP and echo. However, if you really do want the code as you've posted so far:
PHP Code:
<SCRIPT LANGUAGE="JavaScript">
<!--
wt=screen.availWidth;
ht=screen.availHeight;
//alert(wt);
//alert(ht);
//alert(wt+ht);
//-->
</SCRIPT>
<?php
echo '<a href="#" onclick="window.open(\'my-commitment.php\', \'abc\', \'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=\' + wt + \',height=\' + ht + \',top=0,left=0\'); return false;">Click</a>';
?>
The JavaScript code within the onclick attribute could not contain double-quotes as that would close the attribute string prematurely. HTML doesn't have a concept of escaping quotes (ie, onclick="myfunc(\"blah\")" wouldn't work (the onclick value would be myfunc(\ only)). To that end, I've made the HTML use double quotes and the JavaScript use single quotes. Now, since the PHP is echoing a single-quote-delimited sting then the JavaScript's single quotes need to be escaped (once only) in order to make the string valid PHP syntax.
Finally, this would have been a whole lot simpler (and prettier) if you wanted to use nice HTML/JavaScript code in the first place.
Bookmarks