Curl Login
-
arkadaşlar uptimerobot sitesine login olup veri çekmek istiyorum curl ile aram pek iyi değil birkaç şey denedim fakat bana bastığı tek sonuç;
HTTP/1.1 200 OK Date: Sat, 27 Apr 2013 10:47:53 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Content-Length: 4 Content-Type: text/html Set-Cookie: ASPSESSIONIDSSARBTQS=IHEGDLLBBHJNFDOIACOGLPFG; path=/ Cache-control: private true
oldu.
Post adresi : http://www.uptimerobot.com/includes/dml/userDML.asp?action=loginUser
Post içeriği : signInEmail=email adresi&signInPassword=şifre&userRememberMe=0&Submit=Sign-InBu veriler ile nasıl login olabilirim ?
-
http://forum.ceviz.net/php/54816-curl-login-olmak-isteyenler-vardi.html
<?php $mail = "mail adresi"; $pw = "sifre"; $postfields = "signInEmail=$mail&signInPassword=$pw&userRememberMe=0&Submit=Sign-In"; $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookie"); curl_setopt($ch, CURLOPT_URL, "http://www.uptimerobot.com/includes/dml/userDML.asp?action=loginUser"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "$postfields"); curl_exec($ch); curl_close($ch); ?>
-
Yok hocam login olamıyorum. Cookie ye yazdığı false.
# Netscape HTTP Cookie File
# http://curl.haxx.se/rfc/cookie_spec.html
# This file was generated by libcurl! Edit at your own risk.www.uptimerobot.com FALSE / FALSE 0 ASPSESSIONIDSSASDRRT ECCBFHNBFBGJJJDBMKMIAKNE
Maresca tarafından 27/Nis/13 14:34 tarihinde düzenlenmiştir -
UP
-
..
curl_exec($ch)
curl_setopt($ch, CURLOPT_URL,'http://login_olduktan_sonraki_sayfa'); curl_setopt($ch, CURLOPT_HTTPGET,1); curl_exec($ch);login olduktan sonra curl u kapatmadan devam ediyosun.
ama o çıktıyı tam anlamadım netcsape falan diyor agentdan dolayı olabilir sanırım.
$agent ="Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/A.B (KHTML, like Gecko) Chrome/X.Y.Z.W Safari/A.B.";
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
ekleyip dene olmazsa anlayan biri gelir. ben jpegleri çekmede kullanıyorum sadece cURL u. fazla hakim değilim.
-
http://www.uptimerobot.com/api.asp#getMonitors
apileri kullanarak hallettim neyse :) ama yinede login olup bir sayfadan veri çekmeye karşı ilgim var bilen biri yazarsa iyi olur.
-
Cizdireyim. Bana da lazim boyle birsey.