curl-users
Re: Post in a forum
Date: Sat, 23 Aug 2008 10:44:43 +0200
Hi Daniel and thanks,
fine if it is possible. I've already tried to first login in the forum
but I must miss something. Another example with my own phpbb forum,
where the login source code is the following :
/<fieldset class="quick-login">
<label for="username">Nom d'utilisateur:</label> <input name="username" id="username" size="10" class="inputbox" title="Nom d'utilisateur" type="text">
<label for="password">Mot de passe:</label> <input name="password" id="password" size="10" class="inputbox" title="Mot de passe" type="password">
| <label for="autologin">Me connecter automatiquement à chaque visite <input name="autologin" id="autologin" type="checkbox"></label>
<input name="login" value="Connexion" class="button2" type="submit">
</fieldset>
/
Username and Password are very simple and the same : only alphabetical
characters. As you say, I have to first keep the cookie which contains
the collected data of the authentification :
/curl -A "Mozilla/5.0" -d "username=AbCd&password=AbCd=Connexion" -c
"Cookie1.txt" "http://www.nameforum.org/phpBB3/index.php" /
But It gives me the source code of the login page... The cookie
Cookie1.txt contains :
/# Netscape HTTP Cookie File
# http://curlm.haxx.se/rfc/cookie_spec.html
# This file was generated by libcurl! Edit at your own risk.
#HttpOnly_.nameforum.org TRUE / FALSE 1251016841
phpbb3_c9p2n_u 1
#HttpOnly_.nameforum.org TRUE / FALSE 1251016841
phpbb3_c9p2n_k
#HttpOnly_.nameforum.org TRUE / FALSE 1251016841
phpbb3_c9p2n_sid 54b4d6584284c9c612c9c5f3f2dcfc80
/
So, where could be the problem ?
Thank you/
/
Daniel Stenberg a écrit :
> On Sun, 17 Aug 2008, lakk_esbjrn wrote:
>
>> I would like to know if it is possible to post a reply in a forum
>> (phpBB, etc.) using cURL
>
> It is!
>
>> <textarea class="userform" name="message" rows="12"
>> cols="80"></textarea>
>>
>> <input class="userform" value="Post this message" name="valid"
>> accesskey="S" type="submit">
>
>> curl -b "every cookies foud with Live HTTP ( separator = ;)"
>
> That's useless. Cookies very often get unique dynamic content. You
> need to first do a login or similar to get the cookie contents for
> real. And -c is your friend then.
>
> You should also find further reading on this kind of voodoo here:
>
> http://curl.haxx.se/docs/httpscripting.html
>
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2008-08-23