yeah i replaced with:

$ch = curl_init();

                       curl_setopt($ch, CURLOPT_URL,
"http://121.98.150.62:5574/Invoice?txtcode=R5W2"; );
                       curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
                       curl_setopt($ch, CURLOPT_HTTPHEADER,
array('Expect:'));
                       $xmlresponse = curl_exec($ch );
                       echo curl_error($ch);
                       echo $xmlresponse;

dont need POST

On Fri, Aug 20, 2010 at 5:16 PM, Nathan Kennedy
<[email protected]> wrote:
> A further thought, do you need to be using POST? If you are trying to
> replicate the exact below URL, then perhaps it's GET that you're after?
>
> Nathan.
>
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf
> Of Brendan Brink
> Sent: Friday, 20 August 2010 4:58 p.m.
> To: [email protected]
> Subject: [phpug] CURL issue
>
> hi there,
>
> any CURL experts out there?
>
> I use CURL successfully in PHP for processing external pages and
> havent had any issues before.
>
> However today have the following issue:
>
> This the URL i am trying to get info from through CURL:
>
> http://121.98.150.62:5574/Invoice?txtcode=R5W2
>
> When you go to this URL directly, works fine and displays the XML.
>
> However, when I try and address this URL through CURL as follows, I do
> not capture a response.
>
> PHP CODE BELOW
>
>                $ch = curl_init();
>
>                        curl_setopt($ch, CURLOPT_URL,
> "http://121.98.150.62:5574/Invoice?txtcode=R5W2"; );
>                        curl_setopt($ch, CURLOPT_POST, TRUE);
>                        curl_setopt($ch, CURLOPT_POSTFIELDS, $post_str);
>                        curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
>
>                        $xmlresponse = curl_exec($ch );
>                        echo $xmlresponse; //this displays nothing and an
> error when trying
> to import the XML
>                        //extract xml
>
>                         $dom = new domDocument;
>                         $dom->loadXML($xmlresponse);
>                         if (!$dom) {
>                                echo 'Error while parsing the document';
>
>                                $returninfo['status'] = 0;
>                                return $returninfo;
>
>                         }
>
>                         $s = simplexml_import_dom($dom);
>
>
>
> Greatly appreciate anyones help - sorry for a late Friday email!
>
> --
> NZ PHP Users Group: http://groups.google.com/group/nzphpug
> To post, send email to [email protected]
> To unsubscribe, send email to
> [email protected]
>
> --
> NZ PHP Users Group: http://groups.google.com/group/nzphpug
> To post, send email to [email protected]
> To unsubscribe, send email to
> [email protected]

-- 
Kind Regards,

Brendan Brink

SMS Marketing Consultant | Manager
Sell2Cell Ltd.

021 0246 1646 | [email protected] | www.sell2cell.co.nz




  We provide customized, cost-effective SMS & Web Solutions
  Need a website? Need to integrate text-messaging into your business
  or website? Contact us today for a free no-obligation quote!

  VISIT OUR ASSOCIATED WEBSITES:   textvouchers.com | textguru.co.nz

WARNING This email contains information which is CONFIDENTIAL and may
be subject to LEGAL PRIVILEGE. If you are not the intended recipient,
you must not peruse, use, disseminate, distribute or copy the email or
attachments. If you have received this in error, please notify us
immediately by return email, facsimile, or telephone (call us
collect).

-- 
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]

Reply via email to