Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URGENT! Sending XML through HTTP (PHP server)

Status
Not open for further replies.

Shipslitz

Programmer
Jul 21, 2003
10
0
0
US
I've encountered a problem working on a development project and am simply running out of time to find a fix. I've looked for DAYS (literally) and can't seem to find anything that FIXES the problem. ...lots of information, but nothing that actually works.

Using JavaScript, I'm trying to load an XML file, manipulate the data inside it, and send the resulting XML DOM to a PHP page for processing/saving.

First, is this workable?

Second (let's keep it simple), here's my IE code - forget NS:

// Begin JavaScript...
var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlHttp.open("GET", "filename.xml", false);
xmlHttp.send();
var xmlDoc=xmlHttp.responseText;

//...use xmlDoc throughout the application...

var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlHttp.open("POST", " false);
xmlHttp.setRequestHeader("Content-Type","application/xml");
xmlHttp.setRequestHeader("Charsets", "iso-8859-1");
*xmlHttp.send(xmlDoc);
alert(xmlHttp.responseBody);

Here's the problem: When the http request is sent*, how can PHP accpet the XML DOM? What is the appropriate way to access the XML DOM on the PHP side of things (assuming the XML can get there)? For example, is the XML available through the $HTTP_POST_VARS or $_REQUEST array or something? I'm using print_r() to see what's in these arrays...but I get an empty array. Anyone know of any working examples out there?

Any help would be greatly appreciated!
smiletiniest.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top