The first question, is this even possible?
What I need to do is pass the contents of a PHP web page from a
textarea using window.open method to a new browser window and display
it. The page has a combination of HTML and PHP. The problem is that
the PHP is not being interpreted. This is generally resolved by using
the PHP eval() function. However, since the page contents are being
passed via JS, the eval is evaluting the JS statement and not the
actual contents (so I think since the view source shows only the JS).
<script>
var page=window.ope ner.document.fi leedit.pagetext .value;
</script>
<?php
$str = "<script>docume nt.writeln (page)</script>";
eval("\$str = \"$str\";");
echo $str;
?>
If this is possible, what am I missing here?
TIA!
What I need to do is pass the contents of a PHP web page from a
textarea using window.open method to a new browser window and display
it. The page has a combination of HTML and PHP. The problem is that
the PHP is not being interpreted. This is generally resolved by using
the PHP eval() function. However, since the page contents are being
passed via JS, the eval is evaluting the JS statement and not the
actual contents (so I think since the view source shows only the JS).
<script>
var page=window.ope ner.document.fi leedit.pagetext .value;
</script>
<?php
$str = "<script>docume nt.writeln (page)</script>";
eval("\$str = \"$str\";");
echo $str;
?>
If this is possible, what am I missing here?
TIA!
Comment