Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Closed TopicStart new topic
> problem z zalogowaniem curl
wamxx0
post 2.04.2013, 13:46:34
Post #1





Grupa: Zarejestrowani
Postów: 9
Pomógł: 0
Dołączył: 10.03.2013

Ostrzeżenie: (20%)
X----


mam problem z zalogowaniem sie na forum poprzez curl mam taki skrypt:

Kod
<?php
$pole['username'] = 'login';
$pole['password'] = 'password';
$pole['redirect'] = '';
$pole['login'] = 'Zaloguj';
$pole['msg_expire'] = '0';
$pole['accesskey'] = 's';
$pole['tabindex'] = '6';
$pole['msg_icon'] = '0';
$tytul = $_POST['tytul'];
$message = $_POST['opis'];
$link = 'www.cs-homer.xaa.pl/login.php';

$curl = curl_init();
curl_setopt($curl, CURLOPT_TIMEOUT, 10);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_URL, $link);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $pole);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($curl, CURLOPT_COOKIEFILE,  dirname(__FILE__) . '/cookies.txt');
curl_setopt($curl, CURLOPT_COOKIEJAR,  dirname(__FILE__) . '/cookies.txt');
curl_exec($curl);
$result = curl_exec($curl);
$zwrot = $l . '/' . $matches[1][0];
echo "$zwrot <br>";
echo "$result <br>";
curl_close($curl);
?>


oczywiscie podane forum jest przypadkowym forum phpbb tongue.gif dlaczego nie loguje ? zwrot jaki otrzymuje to:
www.cs-homer.xaa.pl/login.php/
--- pola login i password prawidlowo uzupelnione mam u siebie w pliku haha.gif

brak ciasteczek, echo "$result <br>"; nie wyswietla rezultatu
Go to the top of the page
+Quote Post
ssstrz
post 2.04.2013, 14:16:18
Post #2





Grupa: Zarejestrowani
Postów: 103
Pomógł: 17
Dołączył: 15.12.2012

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


tu masz wszystko podane na tacy
Temat: Wyszukiwanie wartosci ukrytej curl
uparta bestia tongue.gif
Go to the top of the page
+Quote Post
artuross
post 2.04.2013, 14:17:11
Post #3





Grupa: Zarejestrowani
Postów: 164
Pomógł: 9
Dołączył: 30.12.2011

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


Sprobuj recznie przechwycic cookies jakie sa zwracane, bo z wlasnego doswiadczenia wiem, ze czasami cURL lekko swiruje i nie zapisuje wszystkich ciasteczek, wykonaj skrypt raz i pokaz zawartosc cpliku cookies.txt, a wszystko bedzie jasne.


--------------------
Pomoglem? Daj pomogl!
Go to the top of the page
+Quote Post
Spawnm
post 2.04.2013, 14:17:35
Post #4





Grupa: Moderatorzy
Postów: 4 069
Pomógł: 497
Dołączył: 11.05.2007
Skąd: Warszawa




Zamykam + moderka.
Go to the top of the page
+Quote Post

Closed TopicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 19.07.2025 - 09:17