Ver Mensaje Individual
  #6 (permalink)  
Antiguo 27/07/2010, 08:47
karenlorenadg
 
Fecha de Ingreso: octubre-2008
Ubicación: Colombia
Mensajes: 448
Antigüedad: 15 años, 7 meses
Puntos: 2
Respuesta: Ejecutar Script cada cierto tiempo

Estoy intentando con Curl puse el siguiente código pero quiero programarlo cada 5 minutos

Código PHP:
Ver original
  1. <?php
  2.  
  3. function get_web_page( $url,$curl_data )
  4. {
  5.     $options = array(
  6.         CURLOPT_RETURNTRANSFER => true,         // return web page
  7.         CURLOPT_HEADER         => false,        // don't return headers
  8.         CURLOPT_FOLLOWLOCATION => true,         // follow redirects
  9.         CURLOPT_ENCODING       => "",           // handle all encodings
  10.         CURLOPT_USERAGENT      => "spider",     // who am i
  11.         CURLOPT_AUTOREFERER    => true,         // set referer on redirect
  12.         CURLOPT_CONNECTTIMEOUT => 300,          // timeout on connect
  13.         CURLOPT_TIMEOUT        => 300,          // timeout on response
  14.         CURLOPT_MAXREDIRS      => 10,           // stop after 10 redirects
  15.         CURLOPT_POST            => 1,            // i am sending post data
  16.            CURLOPT_POSTFIELDS     => $curl_data,    // this are my post vars
  17.         CURLOPT_SSL_VERIFYHOST => 0,            // don't verify ssl
  18.         CURLOPT_SSL_VERIFYPEER => false,        //
  19.         CURLOPT_VERBOSE        => 1                //
  20.     );
  21.  
  22.     $ch      = curl_init($url);
  23.     curl_setopt_array($ch,$options);
  24.     $content = curl_exec($ch);
  25.     $err     = curl_errno($ch);
  26.     $errmsg  = curl_error($ch) ;
  27.     $header  = curl_getinfo($ch);
  28.     curl_close($ch);
  29.  
  30.   //  $header['errno']   = $err;
  31.   //  $header['errmsg']  = $errmsg;
  32.   //  $header['content'] = $content;
  33.     return $header;
  34. }
  35.  
  36. $curl_data = "var1=60&var2=test";
  37. $url = "http://dominio.net/redireccion.html";
  38. $response = get_web_page($url,$curl_data);
  39.  
  40. print '<pre>';
  41. print_r($response);
  42.  
  43. ?>
__________________
Desarrollo de Aplicaciones de Escritorio, Sitios Web, Audio y Video en SISGUS