I have tried to execute a code
xxxxx.php
function showHint(str) { var xhttp; if (str.length == 0) { document.getElementById("IDD").innerHTML = ""; return; } xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("IDD").innerHTML = this.responseText; } }; xhttp.open("GET", "xxxxx.php?q="+str, true); xhttp.send(); }
xxxxx.php
<?php $str=$_GET('str'); echo $str; ?>