CURL kullanarak uzak bir web sitesine giriş yapmayı deniyorum, ancak işe yaramış gibi görünmüyor.Uzak bir web sitesine giriş yapmak için PHP CURL kullanma
Giriş yapmaya çalışıyorum sayfası:
$username="username";
$password="password";
$url="https://vp1-voiceportal.megapath.com/Login/servlet/com.broadsoft.clients.oam.servlets.Login";
$cookie="cookie.txt";
$postdata = "EnteredUserID=".$username."&password=".$password."&domain=&UserID=&rememberPass=";
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt ($ch, CURLOPT_REFERER, $url);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt ($ch, CURLOPT_POST, 1);
$result = curl_exec ($ch);
echo $result;
curl_close($ch);
Ve sonuç nedir? – bossylobster
Ben oturum açma sayfasına beni yönlendirir şu yanıtı alır:
Bulunan
Belge, here numaralı ürüne taşındı. vp1-voiceportal.megapath.com de
Apache Sunucusu Liman 443 – jeffo
1. nasıl çerez dosyasını elde ettiniz? Belki de çerezlerin süresi doldu. 2. Sonuç nedir? Tam olarak ne geri döndü? –