Curl ile post işlemi

flashsezar

Öğrenci
Katılım
17 Ağustos 2009
Mesajlar
1
Reaksiyon puanı
0
Puanları
0
Arkadaşlar curl ile hititbet sitesinden post ettiğim sayfayı almak istiyorum ama bir türlü post edemiyorum. İlk default sayfa geliyor ama post ettiğim sayfa gelmiyor. Kodun neresinde hata yapıyorum.

<?php

$veri = file_get_contents("http://tr.hititbet.com/Results.html");
preg_match('@javax.faces.ViewState" value="(.*?)" autocomplete@si',$veri,$baslik);
$sid = $baslik[1];


$deger = "j_idt42=j_idt42&popupCal_input=30.09.2013&j_i dt44 =>&javax.faces.ViewState=$sid";
$curl = curl_init();
curl_setopt ($curl, CURLOPT_URL, "http://tr.hititbet.com/Results.html");
curl_setopt ($curl, CURLOPT_REFERER, "http://tr.hititbet.com/Results.html");
curl_setopt ($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt ($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt ($curl, CURLOPT_POST, true);
curl_setopt ($curl, CURLOPT_POSTFIELDS, $deger);
$veri = curl_exec($curl);
curl_close($curl);

echo $veri;

?>
 
Üst