Indyarocks.com giriş için PHP ve cURL kullanarak

0 Cevap php

Ben cURL yeni duyuyorum ve bu konuda çok fazla bilmiyorum. Ben temelde PHP libcurl aracılığıyla www.indyarocks.com üzerinde hesabıma giriş yapmak istiyorum. Ben (bunu öğrenmek için nasıl bilmiyorum.) Kullandığı kimlik ne tür bilmiyorum. I http://www.indyarocks.com gittiğinizde, benim kullanıcı adı ve şifre soran bir giriş formu olsun. Ben kullanıcı adı ve şifre koymak ve girişe tıklayın ve her şey iyidir. Ben cURL kullanarak bu otomatikleştirmek için çalıştı. Bu benim bir kod pasajı.

curl_setopt($curl_connection, CURLOPT_URL, "http://www.indyarocks.com/loginchk.php");
curl_setopt($curl_connection, CURLOPT_POST, 1);
curl_setopt($curl_connection, CURLOPT_HTTPAUTH, CURLAUTH_ANY); 
curl_setopt($curl_connection, CURLOPT_USERPWD, $username.':'.$password); 

I looked at the source of the login page and found out the address of the page to which the username and password are sent (the action attribute of the form) which is "http://www.indyarocks.com/loginchk.php" and set it as the target url. When I run this, I get username or password is wrong error and the login fails. My username and password is correct. I don't know what the problem is. Can the password be encrypted? Can that be responsible for this failure?

Please help me get around this problem. I'll be really thankful.

Thanks in advance.

0 Cevap