Skip to content

Instantly share code, notes, and snippets.

Created Oct 2, 2010
What would you like to do?
define(P2_PATH,''); // please change to your P2 path, remember the ending slash.
function pcurl($url,$postargs=false)
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
$response = curl_exec($ch);
if( intval( $responseInfo['http_code'] ) == 200 )
return $response;
return false;
function readit()
$request = P2_PATH.'api.php';
$result = pcurl( $request );
if ($result) return $result;
else return false;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment