I have a php processing page that takes input data from html form and then on my form processing page forwards it to external api using curl.
$response = curl_exec($ch);
$books = new SimpleXMLElement($response);
$result= $books->a1;
$reason= $books->a2;
Surprisingly , the webpages works absolutely fines sometimes and other times gives error
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /home/dir/public_html/dir/big/[login to view URL] Stack trace: #0 /home/dir/public_html/dir/big/[login to view URL](77): SimpleXMLElement->__construct('') #1 {main} thrown in /home/dir/public_html/dir/big/[login to view URL] on line 77
the api when used in when entered in normal browser displays result xml like following :
This XML file does not appear to have any style information associated with it. The document tree is shown below.
test
5.00
2013-09-19 08:21:14 (UTC)
Success
I need someone to solve the issue by making curl_exec : proper that would not make errors
working on teamviewer remote will be appreciated .
BID ONLY IF YOU ARE EXPERT ON PHP & CURL EXEC . IF NOT EXCUSE