cURL / Mailing Lists / curl-users / Single Mail

curl-users

cURL form submition

From: Karolis Linkevicius <karolis.linkevicius_at_gmail.com>
Date: Thu, 8 Jul 2010 14:08:19 +0300

Hi, I have I problem submitting a form. The page code is this:

<html>

    <head>

        <title>

            S4ID IS

        </title>

        <meta http-equiv=Content-Type content="text/html; charset=UTF-8" />

        <link rel="stylesheet" type="text/css"
href="http://www.s4idis.lt//system/application/views/css/login.css" />

    </head>

    <body>

                <form action="http://www.s4idis.lt/index.php/login/validate"
method="post">

        <div id="loginWin">

        <h1>S4ID IS</h1>

 

        <h5>Vartotojo vardas</h5>

        <input type="text" name="username" value="xxxx" size="50" />

 

        <h5>Slaptažodis</h5>

        <input type="password" name="password" value="xxxx" size="50" />

 

        <div id="butt"><input type="submit" name="press" value="Tvirtinti"
/></div>

        </div>

        </form>

 

    </body>

</html>

 

The curl command that have used: curl -d
"username=XXXX&password=XXXX&press=Tvirtinti" -L www.s4idis.lt

After this command I get only the upper html code and I’m not being
redirected to home page. The POST data is correct (I have checked it with
firefox web sniffer).

When using web browser and submitting that form I see that there are two
data transfers being made: POST and GET.

 

POST:

 

Response Headersview source

Date

Thu, 08 Jul 2010 11:01:57 GMT

Server

Apache/2.2.3 (CentOS)

X-Powered-By

PHP/5.2.13

Set-Cookie

ci_session=a%3A4%3A%7Bs%3A10%3A%22session_id%22%3Bs%3A32%3A%22297060724a88f5
87021df582d762a7ca%22%3Bs%3A10%3A%22ip_address%22%3Bs%3A12%3A%2286.38.35.105
%22%3Bs%3A10%3A%22user_agent%22%3Bs%3A50%3A%22Mozilla%2F5.0+%28Windows%3B+U%
3B+Windows+NT+6.1%3B+en-GB%3B+rv%22%3Bs%3A13%3A%22last_activity%22%3Bs%3A10%
3A%221278586917%22%3B%7Db716829200944486b116af20eeee9c39; expires=Thu,
08-Jul-2010 13:01:57 GMT; path=/
ci_session=a%3A6%3A%7Bs%3A10%3A%22session_id%22%3Bs%3A32%3A%22297060724a88f5
87021df582d762a7ca%22%3Bs%3A10%3A%22ip_address%22%3Bs%3A12%3A%2286.38.35.105
%22%3Bs%3A10%3A%22user_agent%22%3Bs%3A50%3A%22Mozilla%2F5.0+%28Windows%3B+U%
3B+Windows+NT+6.1%3B+en-GB%3B+rv%22%3Bs%3A13%3A%22last_activity%22%3Bs%3A10%
3A%221278586917%22%3Bs%3A8%3A%22username%22%3Bs%3A7%3A%22karolis%22%3Bs%3A12
%3A%22is_logged_in%22%3Bs%3A1%3A%221%22%3B%7Ded386356a9f5427112c720c9a413f4c
8; expires=Thu, 08-Jul-2010 13:01:57 GMT; path=/

Location

http://www.s4idis.lt/index.php/mainc/menu

Content-Length

0

Connection

close

Content-Type

text/html

Request Headersview source

Host

www.s4idis.lt

User-Agent

Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.6) Gecko/20100625
Firefox/3.6.6

Accept

text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language

en-gb,en;q=0.5

Accept-Encoding

gzip,deflate

Accept-Charset

ISO-8859-1,utf-8;q=0.7,*;q=0.7

Keep-Alive

115

Connection

keep-alive

Referer

http://www.s4idis.lt/index.php/login/logout

 

GET:

 

Response Headersview source

Date

Thu, 08 Jul 2010 11:01:57 GMT

Server

Apache/2.2.3 (CentOS)

X-Powered-By

PHP/5.2.13

Connection

close

Transfer-Encoding

chunked

Content-Type

text/html

Request Headersview source

Host

www.s4idis.lt

User-Agent

Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.6) Gecko/20100625
Firefox/3.6.6

Accept

text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language

en-gb,en;q=0.5

Accept-Encoding

gzip,deflate

Accept-Charset

ISO-8859-1,utf-8;q=0.7,*;q=0.7

Keep-Alive

115

Connection

keep-alive

Referer

http://www.s4idis.lt/index.php/login/logout

Cookie

ci_session=a%3A6%3A%7Bs%3A10%3A%22session_id%22%3Bs%3A32%3A%22297060724a88f5
87021df582d762a7ca%22%3Bs%3A10%3A%22ip_address%22%3Bs%3A12%3A%2286.38.35.105
%22%3Bs%3A10%3A%22user_agent%22%3Bs%3A50%3A%22Mozilla%2F5.0+%28Windows%3B+U%
3B+Windows+NT+6.1%3B+en-GB%3B+rv%22%3Bs%3A13%3A%22last_activity%22%3Bs%3A10%
3A%221278586917%22%3Bs%3A8%3A%22username%22%3Bs%3A7%3A%22karolis%22%3Bs%3A12
%3A%22is_logged_in%22%3Bs%3A1%3A%221%22%3B%7Ded386356a9f5427112c720c9a413f4c
8

 

I’ve also tried to add Referer and user Agent data, but get the same html
submit form filled with my POST data and not being redirected to home page.
What should I do? Is it a problem with cURL or with the web page? The web
page is created by me so I can easily change the code if needed. Please,
help me!

 

-------------------------------------------------------------------
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 2010-07-08