javascript - Script to return file as string -


what trying simple, haveing problems make work... text on html page changes according text exists on different html file.

main html file:

<html>  <body>        <label for="order2" id="order2"> </label>        <script>            var order2 = returnedfromthephpfile;            document.getelementbyid('order2').innerhtml = order2;        </script> </body> </html> 

here php file:

<?php     $src = fopen('c:\\order.html', 'r');     return $src;     fclose($src); ?> 

the other html file:

<table border="0" cellpadding="0" cellspacing="0"><tr><td width="360" height="190" valign="top">hello</td></tr></table> 

does knows how can this, or if there easier way it?

you want use file_get_contents contents of file string. http://us2.php.net/file_get_contents

$src = file_get_contents("path_to_file.txt") 

Comments

Popular posts from this blog

c++ - How to add Crypto++ library to Qt project -

jQuery Mobile app not scrolling in Firefox -

How to use vim as editor in Matlab GUI -