when user press a submit button then a http post request should be sent to www.example.com/test/add encoding should be utf8 and content type must be text/xml request hast to be structured i.e <abc> <item> <subitem1> <subitem2> etc..
Is this actually a PHP question? It sounds like the job would be done by JavaScript in the browser. Alternatively, if you're wanting to make your PHP script perform the POST request, you can do this with CURL.
If you just need to send the RAW form data , then just use the URL in the action field in the form tag But if you want to sent an XML request , then use CURL
You can do this easily using CURL - of course, you need to construct your XML request first; Something like this [untested] $connection = curl_init(); curl_setopt($connection, CURLOPT_URL, $yourURLtoPostXMLtoo); curl_setopt($connection, CURLOPT_HTTPHEADER, $SendAnyOtherHeadersToo); curl_setopt($connection, CURLOPT_POST, 1); curl_setopt($connection, CURLOPT_POSTFIELDS, $YourPreviouslyConstructedXMLRequest); curl_setopt($connection, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($connection); curl_close($connection); PHP: For more information on headers and setting other curl options as required, see the manual page; http://php.net/manual/en/book.curl.php
+1 on the above answer. Once you execute this, you would then parse the $response. If they return xml you can use simplexml. If you're not sure, run the script and use a var_dump on $response.