Hello, I'm confronted with a problem. I'm trying to include PHP on servers that won't allow PHP. I have two servers, one without PHP and one with PHP.
For this I've written a Include funtion in javascript.
This script is called in de body-section of the non-php document.Code:<script type="text/javascript"> function include(file) { if (document.createElement && document.getElementsByTagName) { var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.setAttribute('type', 'text/javascript'); script.setAttribute('src', file); head.appendChild(script); } else { alert('Your browser can\'t deal with the DOM standard. That means it\'s old. Go fix it!'); } } </script>
<script type="text/javascript">include('http://a-php-server/include.php');</script>
At the php-end I have only one line:
==> This works. My main document shows an alert with some text.Code:<?php echo "alert('some text');"; ?>
Now, when I replace the alert with a document.write like so:
==> Nothing happens. No text is displayed. WHY??Code:<?php echo "document.write('yo yo yo yo');"; ?>
Thanx...



Reply With Quote


Bookmarks