cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Post in a forum

From: lakk_esbjrn <lakk_esbjrn_at_yahoo.fr>
Date: Tue, 02 Sep 2008 20:29:09 +0200

Now that I can post a reply on a phpbb forum, I'm sorry to come back to
you because I have another difficulties to post in an other kind of
forum, this is the forum of which I speak in the first mail, here is the
form :

<textarea class="userform" name="message" rows="12" cols="80"></textarea>

                                                </td>
                                        </tr>
                                                                                <tr>
                                                <td class="default">
                                                        &nbsp;
                                                </td>
                                                <td class="default">
                                                        <input class="userform" value="Poster ce message" name="valid" accesskey="S" type="submit"> <input class="userform" value="Prévisualiser ce message" name="preview" accesskey="P" type="submit">

                                                </td>
                                        </tr>
                                        <tr>
                                                <td class="default_big" style="border-bottom: 1px dotted rgb(170, 170, 170);">
                                                        Options du message
                                                </td>
                                                <td class="default_big" style="border-bottom: 1px dotted rgb(170, 170, 170);">
                                                                                                                <input name="activatesignature" class="userform" value="1" checked="checked" type="checkbox"> Insérer votre signature<br>
                                                                                                                <input name="disablesmilies" class="userform" value="1" type="checkbox"> Désactiver les smilies<br>

I use the same way to login to this page
http://nameforum.com/index.php?page=identify&forum=nameforum, which
source is

<td class="mainbox">
                                                <form action="./index.php?page=identify&amp;forum=nameforum&amp;option=identify" method="post">
                                                        <table style="width: 90%; margin-left: auto; margin-right: auto;">
                                                                <tbody><tr>
                                                                        <td colspan="2">
                                                                                <div class="titresection">Informations personnelles</div>
                                                                        </td>
                                                                </tr>

                                                                <tr>
                                                                        <td>Pseudo</td>
                                                                        <td><input name="nick" size="20" type="text"></td>
                                                                </tr>
                                                                <tr>
                                                                        <td>Mot de passe</td>
                                                                        <td><input name="password" size="20" type="password"></td>
                                                                </tr>

                                                        </tbody></table>
                                                        <table style="width: 100%;">
                                                                <tbody><tr>
                                                                        <td style="width: 50%; text-align: center;"><input value="Annuler" onclick="window.location='./index.php?forum=nameforum" type="button"></td>
                                                                        <td style="width: 50%; text-align: center;"><input value="Valider" type="submit"></td>
                                                                </tr>
                                                        </tbody></table>
                                                        <div class="center">J'ai oublié mon mot de passe</div>
                                                </form>

                                        </td>
                                </tr>
                        </tbody>

I use the command :

 curl -A "Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.9.0.1)
Gecko/2008070400 SUSE/3.0.1-7.1 Firefox/3.0.1" -e
"http://forum.nameforum.com/nameforum" -d
"nick=username&password=password&submit=Valider" -c "CookieMH.txt"
"http://forum.nameforum.com/index.php?page=identify&forum=nameforum" >
coucouMH.html

I'm not authentified because I think one cookie is missing. The only
which is kepted is named "sessionforum", but I'm sure one other is
needed, and is named keyforum => If I add this cookie in the file
CookieMH.txt, I see in the response that I try to post directly "you're
using nickname xxx" which is the correct one.

So my first problem is how to keep all necessary cookies in this login
page ? here is the liveHTTP log :

http://forumnameforum.com/index.php?page=identify&forum=nameforumoption=identify
POST /index.php?page=identify&forum=nameforum&option=identify HTTP/1.1
Host: forum.nameforum.com
User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.9.0.1)
Gecko/2008070400 SUSE/3.0.1-7.1 Firefox/3.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://forum.nameforum.com/index.php?page=identify&forum=nameforum2
Cookie:
__utmz=267689497.1220107118.416.24.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=argument.txt;
Apxxx=1; keytforum=3jnEVeaXDFtmnspk3eg4XXPp442aY3DR;
__utma=213901525.86146944302048160.1213438880.1213726837.1220171532.3;
__utmz=213901525.1220171532.3.2.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=flaskmpeg;
pseudo=jxxx;
__utma=267689497.3761709358129836500.1212511832.1220132230.1220167247.419;
sessionforum=bf71f97230195b0abd9ed2ca9a49be37;
__utmb=267689497.168.10.1220167247; __utmc=267689497; __utmc=213901525
Content-Type: application/x-www-form-urlencoded
Content-Length: 42
nick=xxx&password=xxx
HTTP/1.x 200 OK
Date: Sun, 31 Aug 2008 12:00:33 GMT
Server: Apache/2.2.8 (Unix) PHP/5.2.5
X-Powered-By: PHP/5.2.5
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
X-Software: X2board-2.2
Set-Cookie: keyforum=3jnEVeaXDFtmnspk3eg4XXPp442aY3DR; expires=Mon,
31-Aug-2009 12:00:33 GMT; path=/
Set-Cookie: utilisateur=3jnEVeaXDFtmnspk3eg4XXPp442aY3DR; expires=Mon,
31-Aug-2009 12:00:33 GMT; path=/; domain=.xxx
Vary: Accept-Encoding,User-Agent
Content-Encoding: gzip
Content-Length: 4873
Keep-Alive: timeout=1, max=1000
Connection: Keep-Alive
Content-Type: text/html

If you could suggest me another way, thanks again

-------------------------------------------------------------------
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-09-02