curl-users
Re: cURL and Limesurvey
Date: Wed, 14 Oct 2009 11:29:03 +0200
Yes, I used LiveHTTPHeader to compare headers which has received the
navigator, but still impossible to post (/*Warning*: Missing argument 1
for submitfailed(), called in
/home/genproc/public_html/limesurvey/save.php on line 432 and defined in
*/home/genproc/public_html/limesurvey/index.php* on line /*/1598/)*. In
order to make the request easier to read, it has been modified, there is
now only two fields to fill
http://www.genproc.com/limesurvey/index.php?sid=12148&lang=fr
Here's the last way I've tried, still using -F option :
/curl -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.1.2)
Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)" -e
"http://www.genproc.com/limesurvey/index.php?sid=12148&lang=fr" -c
"cookielime.txt"
"http://www.genproc.com/limesurvey/index.php?sid=12148&lang=fr"
curl -v -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.1.2)
Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)" -b "cookielime.txt"
-e "http://www.genproc.com/limesurvey/index.php?sid=12148&lang=fr" -F
"fieldnames=12148X6X8XP%7C12148X6X8VISTA%7C12148X6X6Lop%7C12148X6X6TDSS"
-F "MULTI12148X6X8=2" -F "1248X6X8XP=Y" -F "java12148X6X8XP=Y" -F
"java12148X6X8VISTA=" -F "display12148X6X8=on" -F "MULTI12148X6X6=2" -F
"12148X6X6Lop=Y" -F "java12148X6XLop=Y" -F "java12148X6X6TDSS=" -F
"display12148X6X6=on" -F "move=movesubmit" -F "move2=+Envoyer+" -F
"thisstep=1" -F "sid=12148" -F "token="
"http://www.genproc.com/limesurvey/index.php" > xu.html
/xu.html contain the error "line 1598". The debug log in the shell is
the following :
/
>curl -v -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.
9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)" -b
"cookielime.txt" -e "http://www.genproc
.com/limesurvey/index.php?sid=12148&lang=fr" -F
"fieldnames=12148X6X8XPC12148X6X8VISTAC12148X6X6LopC
12148X6X6TDSS" -F "MULTI12148X6X8=2" -F "1248X6X8XP=Y" -F
"java12148X6X8XP=Y" -F "java12148X6X8VISTA
=" -F "display12148X6X8=on" -F "MULTI12148X6X6=2" -F "12148X6X6Lop=Y" -F
"java12148X6XLop=Y" -F "jav
a12148X6X6TDSS=" -F "display12148X6X6=on" -F "move=movesubmit" -F
"move2=+Envoyer+" -F "thisstep=1"
-F "sid=12148" -F "token="
"http://www.genproc.com/limesurvey/index.php" 1>xu.html
* About to connect() to www.genproc.com port 80
* Trying 94.23.202.54... connected
* Connected to www.genproc.com (94.23.202.54) port 80
> POST /limesurvey/index.php HTTP/1.1
> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.1.2)
Gecko/20090729 Firefox/3.5.2
(.NET CLR 3.5.30729)
> Host: www.genproc.com
> Accept: */*
> Referer: http://www.genproc.com/limesurvey/index.php?sid=12148&lang=fr
> Cookie: PHPSESSID=a5736f3168bb082bd2b3f574ff1ddc46
> Content-Length: 1740
> Expect: 100-continue
> Content-Type: multipart/form-data;
boundary=----------------------------49ed6d783b9f
>
< HTTP/1.1 100 Continue
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
0 1740 0 0 0 0 0 0 --:--:-- --:--:--
--:--:-- 0< HTTP/1.1 200 OK
< Date: Wed, 14 Oct 2009 09:27:13 GMT
< Server: Apache/1.3.41 (Unix) mod_log_bytes/1.2 mod_bwlimited/1.4
mod_auth_passthrough/1.8 FrontPag
e/5.0.2.2635 mod_ssl/2.8.31 OpenSSL/0.9.8e-fips-rhel5
< Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Pragma: no-cache
< X-Powered-By: PHP/5.2.9
< Transfer-Encoding: chunked
< Content-Type: text/html
100 4377 0 2637 100 1740 5120 3378 --:--:-- --:--:--
--:--:-- 7345* Connection #0 to hos
t www.genproc.com left intact
* Closing connection #0
/And here is what LiveHttpHeaders has recorded after having feeling
manually the survey/
http://www.genproc.com/limesurvey/index.php
POST /limesurvey/index.php HTTP/1.1
Host: www.genproc.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.1.3)
Gecko/20090824 Firefox/3.5.3 GTB5 (.NET CLR 3.5.30729)
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://www.genproc.com/limesurvey/index.php?sid=12148&lang=fr
Cookie: PHPSESSID=1cf5c7f38dea4e262217bb9af1abdde0
Content-Type: application/x-www-form-urlencoded
Content-Length: 309
fieldnames=12148X6X8XP%7C12148X6X8VISTA%7C12148X6X6Lop%7C12148X6X6TDSS&MULTI12148X6X8=2&12148X6X8XP=Y&java12148X6X8XP=Y&java12148X6X8VISTA=&display12148X6X8=on&MULTI12148X6X6=2&12148X6X6Lop=Y&java12148X6X6Lop=Y&java12148X6X6TDSS=&display12148X6X6=on&move=movesubmit&move2=+Envoyer+&thisstep=1&sid=12148&token=
HTTP/1.x 200 OK
Date: Tue, 13 Oct 2009 22:08:51 GMT
Server: Apache/1.3.41 (Unix) mod_log_bytes/1.2 mod_bwlimited/1.4
mod_auth_passthrough/1.8 FrontPage/5.0.2.2635 mod_ssl/2.8.31
OpenSSL/0.9.8e-fips-rhel5
Cache-Control: post-check=0, pre-check=0, no-store, no-cache,
must-revalidate, post-check=0, pre-check=0
Expires: Mon, 26 Jul 1997 05:00:00 GMT
P3P: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
Pragma: no-cache
X-Powered-By: PHP/5.2.9
Set-Cookie: PHPSESSID=deleted; expires=Mon, 13-Oct-2008 22:08:50 GMT; path=/
Last-Modified: Tue, 13 Oct 2009 22:08:51 GMT
Keep-Alive: timeout=15, max=99
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8
----------------------------------------------------------
/And the cookie contain this :/
# Netscape HTTP Cookie File
# http://www.netscape.com/newsref/std/cookie_spec.html
# This file was generated by libcurl! Edit at your own risk.
www.genproc.com FALSE / FALSE 0 PHPSESSID
8d859884de7d979745398c4da6e3ac57
/I'm not sure about this : F
"fieldnames=12148X6X8XP%7C12148X6X8VISTA%7C12148X6X6Lop%7C12148X6X6TDSS"
What d'you thing about that ?
Thanks
Daniel Stenberg a écrit :
> On Mon, 24 Aug 2009, lakk_esbjrn wrote:
>
>> */Could you tell me what's wrong with my code, and what could be the
>> best option (-d or -F) to correctly fill this survey ?
>
> http://curl.haxx.se/docs/faq.html#Why_doesn_t_my_posting_using_F
>
> And for debugging a script, I recomend
>
> Section 14 in http://curl.haxx.se/docs/httpscripting.html
>
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-10-14