if this:
<script language=\"javascript\">
var newWindow = window.open("URL?action=view_record&stockId=".$stockId.", "printout", scrollbars=yes,status=yes,screenX=0,screenY=0,WIDTH=350,height=350);
</script>
is what you are trying to send, then I think your punctuation and spacing are off in the php code. I think the php should be:
echo "<script language=\"javascript\">
var newWindow = window.open(\""URL?action=view_record&stockId=".$stockId."\" , \"printout\", scrollbars=yes,
status=yes,screenX=0,screenY=0,WIDTH=350,height=350);
</script>";
sorry, can't get the spacing correct in this window. Also, the semi-colon inside the double quotes may need to be escaped; not sure. Please let me know if this works because I would like to use the method also.
Mike