How do I write PHP within Javascript so that I can load files? Or is there a better way? (I am loading text files from the server... so I need to use PHP to load those files. I don't know how to handle call backs in PHP but I can do it in Javascript. And from there if I can do some PHP from within the Javascript, I can solve my problem.)
thx
desired sequence:
SaveButton
LoadButton
When the "load button" is pressed, load a textfile from the server into a textbox.
When the "save button" is pressed, save the textbox text to the server.
You may use PHP to create a file that would be used as a JavaScript source.
<script type="text/javascript" src="/my/js/file.php"></script>
or
<script type="text/javascript">
var str = '<?php echo 1+1;?>';
</script>
PHP is serverside. JavaScript is clientside. So you cannot execute either language in the wrong platform.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With