I am attempting to use php to print out a line of text onto a html file, but when I run the html, it merely prints the word undefined. How can I fix this? Here is the code:
HTML:
- <html>
- <head>
- </head>
- <body>
- <script type="text/javascript">
- var xmlhttp=new XMLHttpRequest();
- var textinhtml=document.createElement("div");
- var text=document.createTextNode(xmlhttp.open("GET","http://mikeyrichards.bugs3.com/test.php",true));
- textinhtml.appendChild(text);
- document.body.appendChild(textinhtml);
- xmlhttp.send();
- </script>
- </body>
PHP:
- <?php
- echo "Hello, World"
- ?>