A simple php curl class I wrote a CURL-based PHP5 class, which has simple functions and is suitable for learning. If you really want to use it, it is absolutely recommended that Snoopy be too powerful. Although it is not based on curl.
Php code
Render_postfields ($ vars); // url for generating urlcode $ array [CURLOPT_POST] = true; $ array [CURLOPT_POSTFIELDS] = $ postfields;} // checks whether a cookie exists, if yes, use if ($ _ COOKIE ['cookie _ jar'] | is_file ($ _ cookie ['cookie _ jar']). {$ array [CURLOPT_COOKIEFILE] = $ _ COOKIE ['cookie _ jar']; // Determine the cookie here} else {$ cookie_jar = tempnam ('/tmp ', 'cookies'); // Generate a cookie file $ array [CURLOPT_COOKIEJAR] = $ cookie_jar; // write a cookie Setcookie ('cookie _ jar', $ cookie_jar); // Save the cookie path} curl_setopt_array ($ ch, $ array ); // input the curl parameter $ content = curl_exec ($ ch); // execute curl_close ($ ch); // Close return $ content; // return} protected function render_postfields ($ vars) {foreach ($ vars as $ key => $ values) {$ postdata. = urlencode ($ key ). "= ". urlencode ($ values ). "&" ;}return $ postdata ;}}?>
Usage
Go ('http: // www.renren.com/PLogin.do', $ vars);} else {?>