hi friends iam new to php.
iam posting a variable thorugh javascript using activexobject to a php page
i dont knw how to load the variable in php
my javascript code looks like this
objXMLDoc.appendChild(objXMLDoc.createProcessingInstruction("xml", "version='1.0'"));
//builds the document with the Contact details
objXMLNode = objXMLDoc.createElement("root");
objXMLNode.setAttribute("districtID", cmbDist.value);
objXMLDoc.appendChild(objXMLNode);
objPoster = new ActiveXObject("MSXML2.XMLHTTP.3.0");
with (objPoster) //gets contacts
{
open("POST", "SelectCamps.php, false);
send(objXMLDoc.xml);
}
my php page selectcamps looks like this
$root = $doc->createElement('camps');
$root = $doc->appendChild($root);
if($doc1 = DOMDocument::load($_REQUEST))
{
//$iDistrictID=$doc1->get_attribute('districtID');
$query = "SELECT * FROM m_block where dcode='".$iDistrictID."'";
$resouter = pg_query($dbconnect,$query);
while ($row = pg_fetch_assoc($resouter)) {
$child = $doc->createElement('camp');
$child1 = $root->appendChild($child);
$child1->setAttribute("code", $row['bcode']);
$child1->setAttribute("name", $row['bname']);
}
}
$xml_string = $doc->saveXML();
echo $xml_string;
iam getign error in loading xml
if($doc1 = DOMDocument::load($_REQUEST))
its says it support only strign not an array
how to get the send xml i dont knw
since its not a file name i cnat specify it. if i specify directly a fiel name it works fine..
but i need to load from the previous page plz help me regardign this issue