cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Post in a forum

From: lakk_esbjrn <lakk_esbjrn_at_yahoo.fr>
Date: Fri, 29 Aug 2008 23:14:24 +0200

Daniel Stenberg a écrit :
> On Sun, 24 Aug 2008, lakk_esbjrn wrote:
>
>> So as you said, I use the -F option to post this reply but.... does
>> not work... and AbCd is strangely disconnected a few minutes after
>> (10 minutes approximatively)
>>
>> /curl -b "Cookie1.txt" -F "message=Hello&post=Envoyer"
>> "http://www.NameForum.org/phpBB3/posting.php?mode=reply&f=24&sid=a442603482c15280329f8356306ceb70&t=55"/
>>
>
> This is the wrong -F syntax, see the manual for details.
>
> Also, you need to extract that 'sid' number (or possibly the entire
> POST URL) from the HTML of your previous HTML fetch you cannot re-use
> one used in a previous session.
>

Ok, extract the SID from the authentification is not a problem

/curl -A "Mozilla/5.0" -d "username=xxx&password=xxx&login=Connexion" -c
"Cookie1.txt" "http://www.nameforum.org/phpBB3/ucp.php?mode=login" >
coucou.txt
SID=$(grep -o -m1 "sid=.*\"" coucou.txt | sed 's/sid=//g;s/"//g')/

"echo $SID" give -> 75661bad3cc1a6560a611af494fe683f

I have to add this SID in the parameters of the reply (?)

Then I try :

/curl -b "/home/xxx/Cookie1.txt" -F message=Hello -F post=Envoyer
"http://www.nameforum.org/phpBB3/posting.php?mode=reply&f=24&t=55&sid=75661bad3cc1a6560a611af494fe683f"/

it does not work (response is "you need to be registered to post a
reply...").

Syntax is not correct ? Do I miss something else ?

Thank you

-------------------------------------------------------------------
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-29