cURL / Mailing Lists / curl-users / Single Mail

curl-users

Rookie post question with php action

From: David Plunkett <daveplunkett_at_hotmail.com>
Date: Mon, 01 Sep 2003 16:10:59 -0400

I'm just getting started creating my first PHP web site and this is my
first day trying to use curl. I must be making some really basic mistake.
I can post to my page manually without any trouble. After the post the new
file is moved to a permanent directory with post_action.php.

I'm trying to get the same results using curl as shown below.
curl -F userfile=@/FoxServ/curl/README -F press=OK
http://localhost/post_tst.html

When I do this I get the post_tst.html file echoed back to me in the command
window:
<form method="POST" enctype='multipart/form-data' action="post_action.php"
ID="Form1">
      <input type=file name=userfile ID="File1">
      <input type=submit name=press value="OK" ID="Submit1">
    </form>

Is this expected? How can I confirm that my post_action.php is ever
called? (It doesn't
appear to be.)

The only debugging I tried is using trace. --trace appears to show a
connection and the file being sent.

Please help!

Thanks,
Dave

Trace output:

== Info: About to connect() to localhost:80
== Info: Connected to dell400a (127.0.0.1) port 80
=> Send header, 334 bytes (0x14e)
0000: 50 4f 53 54 20 2f 42 75 67 53 70 6c 61 74 4e 61 POST /BugSplatNa
0010: 76 2f 70 6f 73 74 5f 74 73 74 2e 68 74 6d 6c 20 v/post_tst.html
0020: 48 54 54 50 2f 31 2e 31 0d 0a 55 73 65 72 2d 41 HTTP/1.1..User-A
0030: 67 65 6e 74 3a 20 63 75 72 6c 2f 37 2e 31 30 2e gent: curl/7.10.
0040: 37 20 28 77 69 6e 33 32 29 20 6c 69 62 63 75 72 7 (win32) libcur
0050: 6c 2f 37 2e 31 30 2e 37 20 7a 6c 69 62 2f 31 2e l/7.10.7 zlib/1.
0060: 31 2e 34 0d 0a 48 6f 73 74 3a 20 6c 6f 63 61 6c 1.4..Host: local
0070: 68 6f 73 74 0d 0a 50 72 61 67 6d 61 3a 20 6e 6f host..Pragma: no
0080: 2d 63 61 63 68 65 0d 0a 41 63 63 65 70 74 3a 20 -cache..Accept:
0090: 69 6d 61 67 65 2f 67 69 66 2c 20 69 6d 61 67 65 image/gif, image

...deleted lots of stuff...

0000: 58 2d 50 61 64 3a 20 61 76 6f 69 64 20 62 72 6f X-Pad: avoid bro
0010: 77 73 65 72 20 62 75 67 0d 0a wser bug..
<= Recv data, 213 bytes (0xd5)
0000: 3c 66 6f 72 6d 20 6d 65 74 68 6f 64 3d 22 50 4f <form method="PO
0010: 53 54 22 20 65 6e 63 74 79 70 65 3d 27 6d 75 6c ST" enctype='mul
0020: 74 69 70 61 72 74 2f 66 6f 72 6d 2d 64 61 74 61 tipart/form-data
0030: 27 20 61 63 74 69 6f 6e 3d 22 70 6f 73 74 5f 61 ' action="post_a
0040: 63 74 69 6f 6e 2e 70 68 70 22 20 49 44 3d 22 46 ction.php" ID="F
0050: 6f 72 6d 31 22 3e 0d 0a 20 20 20 20 20 20 3c 69 orm1">.. <i
0060: 6e 70 75 74 20 74 79 70 65 3d 66 69 6c 65 20 6e nput type=file n
0070: 61 6d 65 3d 75 73 65 72 66 69 6c 65 20 49 44 3d ame=userfile ID=
0080: 22 46 69 6c 65 31 22 3e 0d 0a 20 20 20 20 20 20 "File1">..
0090: 3c 69 6e 70 75 74 20 74 79 70 65 3d 73 75 62 6d <input type=subm
00a0: 69 74 20 6e 61 6d 65 3d 70 72 65 73 73 20 76 61 it name=press va
00b0: 6c 75 65 3d 22 4f 4b 22 20 49 44 3d 22 53 75 62 lue="OK" ID="Sub
00c0: 6d 69 74 31 22 3e 0d 0a 20 20 20 20 3c 2f 66 6f mit1">.. </fo
00d0: 72 6d 3e 0d 0a rm>..
== Info: Connection #0 left intact

_________________________________________________________________
Get MSN 8 and enjoy automatic e-mail virus protection.
http://join.msn.com/?page=features/virus

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-09-02