Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $url = "http://rfaf.es/pnfg/NPcd/NFG_CmpJornada?cod_primaria=1000120&CodCompeticion=2063709&CodGrupo=2063742&CodTemporada=10&CodJornada=7&Sch_Codigo_Delegacion=&Sch_Tipo_Juego=";
- print_r(get_web_page($url));
- function get_web_page( $url )
- {
- $ckfile = tempnam ("/tmp", "CURLCOOKIE");
- $options = array(
- CURLOPT_RETURNTRANSFER => true, // return web page
- CURLOPT_HEADER => true, // don't return headers
- CURLOPT_FOLLOWLOCATION => true, // follow redirects
- CURLOPT_ENCODING => "", // handle compressed
- CURLOPT_USERAGENT => "spider", // who am i
- CURLOPT_AUTOREFERER => true, // set referer on redirect
- CURLOPT_CONNECTTIMEOUT => 1200, // timeout on connect
- CURLOPT_TIMEOUT => 1200, // timeout on response
- CURLOPT_MAXREDIRS => 100, // stop after 10 redirects
- CURLOPT_COOKIESESSION => true,
- CURLOPT_COOKIEJAR => $ckfile,
- CURLOPT_COOKIEFILE => $ckfile,
- );
- $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 );
- curl_close( $ch );
- $header['errno'] = $err;
- $header['errmsg'] = $errmsg;
- $header['content'] = $content;
- return $header;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement