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]

Reply via email to