Hi everyone this is my first post so please be gentle with me...
I have an html form with a div id called TextResult
I can get my code to work in html and javascript as below:
However if anyone views source they can see the name of the php script which will eventually contain login information for the server.
Hence I want to hide the php declaration and call it sort of server side.
Now what I want to try however this is in pseudo code and will not work... is...
I may be being silly but I need to hide the script and return the result to the div as in the top javascript code.
Thank you in advance fro any feedback.
I am a newbie to PHP.
I have an html form with a div id called TextResult
I can get my code to work in html and javascript as below:
Code:
<script LANGUAGE=Javascript>
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("TextResult").innerHTML = this.responseText;}};
xhttp.open("GET", "test.php", true);
xhttp.send();
</script>
Hence I want to hide the php declaration and call it sort of server side.
Now what I want to try however this is in pseudo code and will not work... is...
Code:
<script LANGUAGE=Javascript>
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("wb_txtJS").innerHTML = [b] <?php require('test.php'); ?>[/b] ;}};
xhttp.open("GET", "test.php", true);
xhttp.send();
</script>
I may be being silly but I need to hide the script and return the result to the div as in the top javascript code.
Thank you in advance fro any feedback.
I am a newbie to PHP.