PHP curl response diff with url response

I have this URL access : http://bookings.seawings.ae/remoteconnect/default.asp?XML=<cs> +<o+n%3D"authenticationcode"+v%3D"d657cce7fa320a23950dca157fe693b8"%2F> +<c+n%3D"flightsearch"> ++<q+n%3D"StartDate"+v%3D"11-Apr-2012"%2F> ++<q+n%3D"EndDate"+v%3D"11-Apr-2014"%2F> ++<q+n%3D"Typeofflight"+v%3D"SILVER"%2F> ++<q+n%3D"Seats_Adult"+v%3D"8"%2F> +<%2Fc> <%2Fcs>

and it returns :

but when I try to run it in PHP:

<?php $request_xml = '<cs> <o n="authenticationcode" v="d657cce7fa320a23950dca157fe693b8"/> <c n="FlightSearch"> <q n="StartDate" v="1-Jul-2013"/> <q n="EndDate" v="30-Jul-2013"/> <q n="Seats_adult" v="3"/> </c> </cs>'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://bookings.seawings.ae/remoteconnect/default.asp'); //curl_setopt($ch, CURLOPT_USERPWD, $username.':'.$password); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSLVERSION, 3); curl_setopt($ch, CURLOPT_TIMEOUT, 4); curl_setopt($ch, CURLOPT_POSTFIELDS, $request_xml); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: close')); $result = curl_exec($ch); echo stripslashes($result); curl_close($ch); ?>

I don’t see you pass parameters in php.

Also check option verbose in PHP and write the log to file.
Same with CURL classes in MBS Plugin and compare.

Hi Sir Christian. I’m just trying to replicate the response to PHP when you click the URL. I’m a newbie at this and trying to learn.

I tried replacing curl_setopt($ch, CURLOPT_URL, ‘https://bookings.seawings.ae/remoteconnect/default.asp’); to http and I’m getting a response of “’’”. The parameters I pass is hardcoded and I’m sorry for asking a stupid question. How do you “Also check option verbose in PHP and write the log to file.”

The URL above has parameters which you may need to pass

Is this the parameters like in the URL access? XML=%3Ccs%3E%0D%0A+%3Co+n%3D%22authenticationcode%22+v%3D%22d657cce7fa320a23950dca157fe693b8%22%2F%3E%0D%0A+%3Cc+n%3D%22flightsearch%22%3E%0D%0A++%3Cq+n%3D%22StartDate%22+v%3D%2211-Apr-2012%22%2F%3E%0D%0A++%3Cq+n%3D%22EndDate%22+v%3D%2211-Apr-2014%22%2F%3E%0D%0A++%3Cq+n%3D%22Typeofflight%22+v%3D%22SILVER%22%2F%3E%0D%0A++%3Cq+n%3D%22Seats_Adult%22+v%3D%228%22%2F%3E%0D%0A+%3C%2Fc%3E%0D%0A%3C%2Fcs%3E

In the php code:
$request_xml = ’ ';
curl_setopt($ch, CURLOPT_POSTFIELDS, $request_xml);

Got this from verbose log:

  • Trying 213.42.28.157…
  • TCP_NODELAY set
  • Connected to bookings.seawings.ae (213.42.28.157) port 80 (#0)

POST /remoteconnect/default.asp HTTP/1.1
Host: bookings.seawings.ae
Accept: /
Content-Length: 297
Content-Type: application/x-www-form-urlencoded

  • upload completely sent off: 297 out of 297 bytes
    < HTTP/1.1 200 OK
    < Date: Mon, 27 Mar 2017 08:51:41 GMT
    < Server: Microsoft-IIS/6.0
    < MicrosoftOfficeWebServer: 5.0_Pub
    < X-Powered-By: ASP.NET
    < Access-Control-Allow-Origin: *
    < Content-Length: 273
    < Content-Type: text/xml
    < Set-Cookie: STATION=st%5Fdxb; expires=Wed, 26-Apr-2017 08:51:40 GMT; path=/
    < Set-Cookie: ASPSESSIONIDQSSRQTAT=LEDKEKMDMGBFDKDGOAIAPBBE; path=/
    < Cache-control: private
    <
  • Curl_http_done: called premature == 0
  • Connection #0 to host bookings.seawings.ae left intact