title: TNT Express Connect Pricing module Using PHP
body: <p>I need to connect to the TNT Expressconnect and get pricing details for given weight and volume of products I am using PHP and try to connect with this lines of codes which is in <a href="https://stackoverflow.com/questions/18719502/php-post-xml-request-to-server-tnt-express-connect-pricing-module?answertab=active">PHP Post XML Request to server ( TNT Express Connect Pricing module)</a></p>
  
  <pre><code>&lt;?php
  /**
   *  Submit XML to the TNT
   *  server via a Stream instead
   *  of cURL. 
   *
   *  @Returns String (XML)
  **/
  
  error_reporting(E_ALL);
  ini_set('display_errors', 1);
  
  function sendToTNTServer( $Xml ) {
  
  $postdata = http_build_query(
                     array(
                       //For Future reference
                       //the xml_in= ( the = ) is appended
                       //Automatically by PHP
                      'xml_in' =&gt; $Xml 
                     )
          );
  
  $opts = array('http' =&gt;
              array(
                 'method'  =&gt; 'POST',
                 'header'  =&gt; 'Content-type: application/x-www-form-urlencoded',
                 'content' =&gt; $postdata
               )
           );
  
  $context  = stream_context_create( $opts );
  $output = file_get_contents( 
         'https://express.tnt.com/expressconnect/pricing/getprice', 
         false, 
         $context 
       );
  
       return $output;
  }
  
  $XmlString = "&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt; 
                &lt;PRICEREQUEST&gt; 
                     &lt;LOGIN&gt; 
                         &lt;COMPANY&gt;CITXXXXXX&lt;/COMPANY&gt; 
                         &lt;PASSWORD&gt;XXXXX&lt;/PASSWORD&gt; 
                         &lt;APPID&gt;PC&lt;/APPID&gt; 
                     &lt;/LOGIN&gt; 
                     &lt;PRICECHECK&gt; 
                         &lt;RATEID&gt;rate1&lt;/RATEID&gt; 
                         &lt;ORIGINCOUNTRY&gt;AUD&lt;/ORIGINCOUNTRY&gt; 
                         &lt;ORIGINTOWNNAME&gt;Atherstone&lt;/ORIGINTOWNNAME&gt; 
                         &lt;ORIGINPOSTCODE&gt;CV9 2RY&lt;/ORIGINPOSTCODE&gt; 
                         &lt;ORIGINTOWNGROUP/&gt; 
                         &lt;DESTCOUNTRY&gt;ES&lt;/DESTCOUNTRY&gt; 
                         &lt;DESTTOWNNAME&gt;Alicante&lt;/DESTTOWNNAME&gt; 
                         &lt;DESTPOSTCODE&gt;03006&lt;/DESTPOSTCODE&gt; 
                         &lt;DESTTOWNGROUP/&gt; 
                         &lt;CONTYPE&gt;N&lt;/CONTYPE&gt; 
                         &lt;CURRENCY&gt;GBP&lt;/CURRENCY&gt; 
                         &lt;WEIGHT&gt;0.2&lt;/WEIGHT&gt; 
                         &lt;VOLUME&gt;0.1&lt;/VOLUME&gt; 
                         &lt;ACCOUNT/&gt; 
                         &lt;ITEMS&gt;1&lt;/ITEMS&gt; 
                   &lt;/PRICECHECK&gt; 
              &lt;/PRICEREQUEST&gt;";
  
  $returnXml = sendToTNTServer( $XmlString );
      echo $returnXml;
  ?&gt;
  </code></pre>
  
  <p>but this code give me an error of <strong>login details not recognised</strong></p>