All pastes #425842 Raw Edit

Untitled

public php v1 · immutable
·published 2007-04-05 19:18 UTC
rendered paste body
//this is the ajax handler..//I'd like to pass the form's POST variables, through - //only explicit GET is working..any clues?  //Create a boolean variable to check for a valid Internet Explorer instance.  var xmlhttp = false;  //Check if we are using IE.  try {    //If the Javascript version is greater than 5.    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");  } catch (e) {    //If not, then use the older active x object.    try {      //If we are using MS.      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");    } catch (E) {      //Else we must be using a non-IE browser.      xmlhttp = false;    }  }  //If we are using a non-IE browser, create a javascript instance of the object.  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {    xmlhttp = new XMLHttpRequest();  }  /*  var xmlhttp;  //If, the activexobject is available, we must be using IE.  if (window.ActiveXObject){    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");  } else {    //Else, we can use the native Javascript handler.    xmlhttp = new XMLHttpRequest();  }  */  function makerequest(serverPage, objID) {    var obj = document.getElementById(objID);    //xmlhttp.open("GET", serverPage);    xmlhttp.open("POST", serverPage);    xmlhttp.onreadystatechange = function() {      if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {        obj.innerHTML = xmlhttp.responseText;      }    }    xmlhttp.send(null);  }  function makerequest2(serverPage, objID) {    var obj = document.getElementById(objID);    //xmlhttp.open("GET", serverPage);    xmlhttp.open("POST", serverPage);    xmlhttp.onreadystatechange = function() {      if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {        obj.innerHTML = xmlhttp.responseText;      }    }    //xmlhttp.send(null);    xmlhttp.send("?list_departments="+document.getElementsByName("list_departments")[0].value);  }..//this is the request in the main page..  <td>        <form method="post" name="form1" action="<? echo $path ?>" style="margin-bottom:0;">          <input type="hidden" name="list_departments" value="1">          <input type="image" src="/feathersoft/images/list.png" alt="List" border="0"' ;?> onclick="makerequest('departments.php', 'hw');  return false;" <?echo '/>        </form>      </td>..//variable is then read and echoed after the above form submit$list_departments= isset ($_POST['list_departments']) ? $_POST['list_departments'] : '';