Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Automatyczne logowanie
Watt
post
Post #1





Grupa: Zarejestrowani
Postów: 372
Pomógł: 1
Dołączył: 13.06.2008

Ostrzeżenie: (0%)
-----


Witam!

Chciałem zarobić trochę $ na uploadzie plików na wiele serwisów, pomyślałem sobie, że automat zrobi to za mnie lepiej no i oczywiście utknąłem na zanym początku (IMG:style_emoticons/default/sad.gif) problemem jest serwis rapidgator, napisałem curla, aby się tam logował no i skubaniec nie odbira sesji - nie wiem dlaczego!

Czesc ich kodu html z logowaniem:
Kod
                   <form id="login" action="/auth/login" method="post">
                        <div class="popup-login hidden">
                            <input type="text" class="txt up-login" name="LoginForm[email]"/>
                            <input type="password" class="txt up-login" name="LoginForm[password]"/>
                            <div class="wrap">
                                <div class="inp">
                                    <p><input type="checkbox" class="ch" id="rem"  checked="checked" name="LoginForm[rememberMe]" value="1"/> <label for="rem">Remember me</label></p>
                                    <a href="/account/ForgotPassword" class="restore">Forgot password</a>
                                </div>
                                <a class="btn-login" style="cursor:pointer;" onclick ="document.forms.login.submit();">Login</a>
                            </div>
                        </div>
                    </form>


Mój kod:
Kod
<?php
$cookie_file = 'cookie.txt';

$c = curl_init('http://rapidgator.net/');
curl_setopt($c, CURLOPT_COOKIEJAR, $cookie_file);
curl_setopt($c, CURLOPT_COOKIEFILE, $cookie_file);
curl_setopt($c, CURLOPT_URL, 'http://rapidgator.net/auth/login');
curl_setopt($c, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12;");
curl_setopt($c, CURLOPT_POST, 1);
curl_setopt($c, CURLOPT_POSTFIELDS,
'LoginForm[email]=xxx@gmail.com&LoginForm[password]=xxx123&LoginForm[rememberMe]=1');
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_getinfo($c);
$s = curl_exec($c);
curl_close($c);
echo "Poszlo?";
print_r($s);

?>


Dlaczego ten kod nie działa, coś napisałem źle?
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 24.08.2025 - 04:03