İçeriğe geç
ShiftDelete.Net
Haber ara/ SDN'ye SorGiriş
Haber Akışı SDNTV İnceleme Forum Yapay Zeka Akıllı Telefon Elektrikli Otomobil Oyun ShiftDelete.Net Global Teknoloji Haberleri Mobil Otomobil Donanım Savunma Bilim Sosyal Medya İnternet Giyilebilir Teknoloji Rehber Ürünler Son dakika Yazarlar
  1. Ana sayfa
  2. Topluluk
  3. Programlama
  4. Web Programlama (PHP, ASP, HTML, CSS, JavaScript)
Web Programlama (PHP, ASP, HTML, CSS, JavaScript)

Curl ile post işlemi

flashsezar30.09.20130 cevap1.602 görüntüleme
2009'den beri1 mesaj
#1
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;

?>

Cevabını yaz

Cevap yazmak için giriş yap ya da üye ol. Eski forum kullanıcı adın ve parolanla girebilirsin.