<?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 ?
Teşekkür ederim.



awoken adlı üyeden alıntı: mesajı görüntüle
Merhaba. İlk önce yapmanız gereken login formunun post edidiği urlyi görmek. Ardından curl ile o url adresine kullanıcı adı ve parolayı post etmeniz gerekli. Bu işlemleri yaptığınızda karşı sitede sizin için bir session oluşur, bu session açık olduğu sürece oturumunuz açık demektir. Curl'de sessionun kapanmaması için CURLOPT_COOKIEJAR ve CURLOPT_COOKIEFILE özelliklere ihtiyacınız olacak. Biraz karışık oldu bir örnek vereyim.

$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
Object moved to here.

hatası alıyorum.