I did something similar to this, and this should work...
// Get the javascript code from your document
$js_data = $your_document_data;
$js_data = eregi_replace(".<script", "", $js_data);
$js_data = eregi_replace("</script>.", "", $js_data);
// Replace the code with nothing in your document data. This replace code will, however, keep the <script> tags in the document, there will just be nothing inside them.
$your_document_data = ereg_replace("$js_data", "", $your_document_data;
Basicly, if anyone trys to put anything in <script> tags, it will delete it.
// This code will get rid of everything, including the script tags
$your_document_data = eregi_replace("<script . $js_data . </script>", "", $your_document_data);
This isn't tested, so there may be a few bugs.. I dunno.
Let me know
-Alex Augot
Teradyne, Inc