How does php obtain the xml data of the request, the xml data submitted by the other Party through the http post protocol, and how does php obtain the xml data?
Copy codeThe Code is as follows:
<? Php
$ Xml_data = '<AATAvailReq1> '.
'<Agency> '.
'< Iata> 1234567890 </Iata> '.
'<Agent> lgsoftwares </Agent> '.
'<Password> mypassword </Password> '.
'<Brand> phpmind.com </Brand> '.
'</Agency> '.
'<Passengers> '.
'<Adult AGE = "" ID = "1"> </Adult> '.
'<Adult AGE = "" ID = "2"> </Adult> '.
'</Passengers> '.
'<Your availreq1> '.
'<DestCode> JHM </DestCode> '.
'<Response code> OGGSHE </response code> '.
'<CheckInDate> 101009 </CheckInDate> '.
'<CheckOutDate> 101509 </CheckOutDate> '.
'<UseField> 1 </UseField> '.
'</Your availreq1> '.
'</AATAvailReq1> ';
$ 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 ($ ch, CURLOPT_SSL_VERIFYPEER, 0 );
Curl_setopt ($ 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 );
?>