pls help sending xml using php

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • shotokan99

    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

  • Erwin Moller

    #2
    Re: pls help sending xml using php

    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:


    Regards,
    Erwin Moller

    Comment

    • shotokan99

      #3
      Re: pls help sending xml using php

      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>63 9191111111</mobilephone>
      <PIN>111</PIN>
      <password>mypas sword</password>
      <firstname>Firs tname</firstname>
      </requestdetails>
      </body>
      <footer>
      <end>1</end>
      </footer>
      </xxx>
      ';
      require_once 'HTTP/Request.php';
      $xr=" https://mygateway.com";
      $req = &new HTTP_Request($x r);
      $req->setMethod(HTTP _REQUEST_METHOD _POST);
      $req->addRawPostData ($xxml);
      $req->sendRequest( );

      echo nl2br(htmlentit ies($xxml));
      echo "<p>&nbsp;</p>";
      echo nl2br(htmlentit ies($req->getResponseBod y()));
      echo 'it works...';

      Comment

      Working...