468,741 Members | 2,035 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,741 developers. It's quick & easy.

pls help sending xml using php

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
2 1472
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
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.

Similar topics

1 post views Thread by coder_1024 | last post: by
13 posts views Thread by joe215 | last post: by
3 posts views Thread by Ant | last post: by
3 posts views Thread by Sells, Fred | last post: by
9 posts views Thread by Miro | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
xarzu
2 posts views Thread by xarzu | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.