By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,290 Members | 1,411 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,290 IT Pros & Developers. It's quick & easy.

pls help sending xml using php

P: n/a
hi,

i need to send an xml document to http://mygateway.com.. using php how
can i do this? i already have the structure of the xml. all i need to
do is fill up the fields and send.

tnx

Jun 7 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
shotokan99 wrote:
hi,

i need to send an xml document to http://mygateway.com.. using php how
can i do this? i already have the structure of the xml. all i need to
do is fill up the fields and send.

tnx
Hi,

Read up here:
http://www.php.net/curl

Regards,
Erwin Moller
Jun 7 '07 #2

P: n/a
this is how i handled this issue. is this a good approached?
=======================================

$xxml='
<?xml version="1.0" encoding="UTF-8"?>
<xxx>
<header>
<mtid101 </mtid>
</header>
<body>
<request>RVA</request>
<requestdetails>
<mobilephone>639191111111</mobilephone>
<PIN>111</PIN>
<password>mypassword</password>
<firstname>Firstname</firstname>
</requestdetails>
</body>
<footer>
<end>1</end>
</footer>
</xxx>
';
require_once 'HTTP/Request.php';
$xr=" https://mygateway.com";
$req = &new HTTP_Request($xr);
$req->setMethod(HTTP_REQUEST_METHOD_POST);
$req->addRawPostData($xxml);
$req->sendRequest();

echo nl2br(htmlentities($xxml));
echo "<p>&nbsp;</p>";
echo nl2br(htmlentities($req->getResponseBody()));
echo 'it works...';

Jun 8 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.