note 70198 added to function.curl-exec
| From: | lukasl at ackleymedia dot com | Date: | Fri, 06 Oct 2006 14:52:59 +0000 |
| Subject: | note 70198 added to function.curl-exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-118128@lists.php.net to get a copy of this message | ||
Thank you for sharing this. I was wondering why my result was 1.
To get around this in a safe way, this is how I check if the result is valid.
$ch = curl_init(); /// initialize a cURL session
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$xmlResponse = curl_exec ($ch);
curl_close ($ch);
if (!is_string($xmlResponse) || !strlen($xmlResponse)) {
return $this->_set_error( "Failure Contacting Server" );
} else {
return $xmlResponse;
}
----
Server IP: 66.163.161.117
Probable Submitter: 74.96.132.143
----
Manual Page -- http://www.php.net/manual/en/function.curl-exec.php
Edit -- https://master.php.net/note/edit/70198
Del: integrated -- https://master.php.net/note/delete/70198/integrated
Del: useless -- https://master.php.net/note/delete/70198/useless
Del: bad code -- https://master.php.net/note/delete/70198/bad+code
Del: spam -- https://master.php.net/note/delete/70198/spam
Del: non-english -- https://master.php.net/note/delete/70198/non-english
Del: in docs -- https://master.php.net/note/delete/70198/in+docs
Del: other reasons-- https://master.php.net/note/delete/70198
Reject -- https://master.php.net/note/reject/70198
Search -- https://master.php.net/manage/user-notes.php