I look at the console.log, the requestURL is able to pass the value like www.example.com/test?q=1.
unfortunately,when it request by the server site, the get value is not assigned to the variable $_GET['q']; As a result, i couldn't manipulate the value after the request.
Do you have any idea what've I missed ? or it is fundamentally not allow to do in the same page.
$anyvar = $_GET['q'];
- function showData(str)
- {
- bool = false;
- var str1 = "";
- if(str == "")
- {
- document.getElementById("select_field").innerHTML = "";
- return;
- }
- else
- {
-
- if(window.XMLHttpRequest)
- {
- xmlhttp = new XMLHttpRequest();
- console.log(xmlhttp);
- }
- else
- {
- xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
- console.log(xmlhttp);
- }
- xmlhttp.onreadystatechange = function()
- {
- if(xmlhttp.readyState == 4 && xmlhttp.status == 200)
- {
- document.getElementById("select_field").innerHTML=document.getElementById("selection").innerHTML;
- }
- };
-
- }
- xmlhttp.open("GET", "reports.php?q=" + str, true);
- xmlhttp.send();
- }