PHP obtains xml data submitted through http protocol post and parses xml_PHP tutorial

WBOY
Release: 2016-07-21 15:14:51
Original
1101 people have browsed it

How does PHP obtain the requested XML data? The other party submits the XML data through HTTP protocol post. How does PHP obtain this data?

Copy code The code is as follows:

$xml_data =''.
''.
'1234567890'. Password>'.
'phpmind.com'.
'
'. ="" ID="1">'.
''.
'''.
'JHM'. ;101009'.
'101509'. 🎜>'
';
$URL = "https://www.yourwebserver.com/path/";
$ch = curl_init($URL);
curl_setopt($ch , Curlopt_mute, 1);
Curl_Setopt ($ ch, curlopt_ssl_verifyHost, 0);
Curl_Setopt t ($ ch, curlopt_post, 1);
Curl_Setopt ( $ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml_data");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
?>





http://www.bkjia.com/PHPjc/326221.html

www.bkjia.com

true
http: //www.bkjia.com/PHPjc/326221.html

TechArticle

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template