Hi,
you can find a lot of info on the web, with a search engine.
However...
A common way is to encrypt the code with a urlencoder and do a document.write() of string.
<script>
<?
echo "document.write(unescape(\"";
echo rawurlencode("<script>window.status='maccaroni!!!'</script>");
echo "\"));";
?>
</script>
see you