Bir projede kullanılmak üzere veri çekmem gerekmektedir.
fakat veri çekeceğim sitede kullanıcı adı ve şifre kısmı olduğu için veri çekilmiyor. CURL ile kullanıcı adı ve şifre girdikten sonra veri çekebilir miyim?

5
●197

$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://site.com/login.php');curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, "username=kullanici_adi&password=parola"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_COOKIESESSION, true); curl_setopt($ch, CURLOPT_COOKIEJAR, ''); curl_setopt($ch, CURLOPT_COOKIEFILE, ''); $response = curl_exec($ch);// ilk giriş işlemimizi tamamladık, karşı site bizi giriş yapmış olarak görüyor. curl_setopt($ch, CURLOPT_URL, 'http://site.com/veri'); curl_setopt($ch, CURLOPT_POST, false); curl_setopt($ch, CURLOPT_POSTFIELDS, ""); $sonuc = curl_exec($ch); // $sonuc değişkeni çekmek istediğimiz veri
<?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://web.arvento.com/signin.aspx');curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, "username=1&password=1"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_COOKIESESSION, true); curl_setopt($ch, CURLOPT_COOKIEJAR, ''); curl_setopt($ch, CURLOPT_COOKIEFILE, ''); $response = curl_exec($ch);// ilk giriş işlemimizi tamamladık, karşı site bizi giriş yapmış olarak görüyor. curl_setopt($ch, CURLOPT_URL, 'https://web.arvento.com/maps'); curl_setopt($ch, CURLOPT_POST, false); curl_setopt($ch, CURLOPT_POSTFIELDS, ""); $sonuc = curl_exec($ch); // $sonuc değişkeni çekmek istediğimiz veri echo $ch ?>Kullanıcı adı ve şifreyi doğru girince kod çalışmıyor acaba nerede hatam var ?
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://web.arvento.com/ajax/login.ashx?u=kullanici_adi&p1=parola'); curl_setopt($ch, CURLOPT_POST, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_COOKIESESSION, true); curl_setopt($ch, CURLOPT_COOKIEJAR, ''); curl_setopt($ch, CURLOPT_COOKIEFILE, ''); $response = curl_exec($ch);// ilk giriş işlemimizi tamamladık, karşı site bizi giriş yapmış olarak görüyor. curl_setopt($ch, CURLOPT_URL, 'https://web.arvento.com/maps'); curl_setopt($ch, CURLOPT_POST, false); curl_setopt($ch, CURLOPT_POSTFIELDS, ""); $sonuc = curl_exec($ch); // $sonuc değişkeni çekmek istediğimiz veri echo $sonuc;Böyle dener misiniz?