Jump to content

PHP script receives XML file from client


Guest varelg

Recommended Posts

Javascript script on the client communicates with the server through XMLHTTP object and sends XML file through xmlObject.send() method via POST to a PHP script on the server. How to get that file to pass through a parser set up serverside (in the PHP script)?Would it be through $_POST['the_ name_ of_ variable_that_holds_xml_file_as_string']?Like in the form of:

<script type="text/javascript>var incomingXml="<person>John Doe</person>";//intialization of xmlhttp object here...xmlHttp.send(incomingXml);</script>

And later in PHP script on the server:

<?php$incoming_xml = $_POST['incomingXml']?>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...