Webmaster Forum
Go Back   Webmaster forum » ..:: Web Design ::.. » Script

Reply
 
Thread Tools Display Modes
  #1  
Old 24-09-2009
ravi72194 ravi72194 is offline
Member
 
Join Date: Jun 2009
Posts: 44
iTrader: (0)
ravi72194 is on a distinguished road
Talking Post XML through curl

Here is a simple script to post XML through curl
HTTP POST

<?php
$xml_data ='<Req1>'.
'<Agency>'.
'<Iata>34567</Iata>'.
'<Agent>thegetpr</Agent>'.
'<P***word>myp***word</P***word>'.
'<Brand>google.com</Brand>'.
'</Agency>';

$URL = "https://www.yoursitename.com/path/";

$ch = curl_init($URL);
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);

?>

Last edited by ravi72194; 24-09-2009 at 04:08 PM.
Reply With Quote
Reply

Bookmarks

Tags
curl, http, post, xml

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:54 PM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.