Posts

Showing posts with the label liberary

Using CURL liberary in php

Using CURL liberary in php The curl liberary in php is very powerfull liberary to get the remote sarver result. Example:s you can get facebook users photo, google map, gmail, and various webservice. Code of curl liberary using basic: Example code to get facebook user photo:   true, // return web page CURLOPT_HEADER => false, // dont return headers CURLOPT_FOLLOWLOCATION => true, // follow redirects CURLOPT_ENCODING => "", // handle all encodings CURLOPT_USERAGENT => "spider", // who am i CURLOPT_AUTOREFERER => true, // set referer on redirect CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect CURLOPT_TIMEOUT => 120, // timeout on response CURLOPT_MAXREDIRS => 10, // stop after 10 redirects ); $url = "http://graph.facebook.com/".$id."/picture"; $ch = curl_init( $url ); curl_setopt_array( $ch, $options ); $content = curl_exec( $ch ); $err = curl_errno( $ch ); $errmsg = curl_error( $ch ); $header = curl_getinfo( $ch ); cur...