Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/01/2012, 23:42
czfritz
 
Fecha de Ingreso: agosto-2010
Ubicación: peru
Mensajes: 115
Antigüedad: 14 años, 7 meses
Puntos: 0
problema curl y cookies

hola buen dia
por favor ayudenme que ya no puedo mas intente de todas formas y no me sale
la verdad es que tengo un coookie de tariga.net y quiero jalar los posts privados y no me sale ya que intente de diferentes maneras aqui les dejo el codigo
Código PHP:
<?php
function GetHTML($strURL){
    
$_curl curl_init();
    
curl_setopt($_curlCURLOPT_REFERER$strURL);
    
curl_setopt($_curlCURLOPT_USERAGENT"Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3");
    
curl_setopt($_curlCURLOPT_RETURNTRANSFER1);
            
#$cookie = array("Cookie: $cookie");
$cookie = array("Cookie: img_host=1; SAV2=1140122501.36606ba3; __gads=ID=0c6325977d856452:T=1318262296:S=ALNI_MYUrhWjSc1HanJWKewVHFosrWVwEg; __utma=191395631.2096305582.1318262308.1318262308.1318265692.2; __utmz=191395631.1318262308.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __qca=P0-1741169349-1318262308074; trngssn=50038517; __utmb=191395631.1.10.1318265692; __utmc=191395631");
    
curl_setopt($_curlCURLOPT_HTTPHEADER$cookie);
    
curl_setopt($_curlCURLOPT_URL$strURL);
    
$buffer curl_exec($_curl);
    
curl_close($_curl);
    
    return 
$buffer;
}
$taringa=GetHTML("http://www.taringa.net/posts/ciencia-educacion/12386944/Kaspersky-Internet-Security-2012-FINAL-Espanol--Serial-_-Ki.html");
preg_match_all("#<hr />(.*?)</div><!-- post-content -->#s",$taringa,$pag);
echo 
$pag[1][0];
?>