xref: /PHP-7.1/sapi/tests/test006.phpt (revision 113213f0)
1--TEST--
2Multipart Form POST Data
3--HEADERS--
4return <<<END
5Content-Type=multipart/form-data; boundary=---------------------------240723202011929
6Content-Length=862
7END;
8--ENV--
9return <<<END
10CONTENT_TYPE=multipart/form-data; boundary=---------------------------240723202011929
11CONTENT_LENGTH=862
12END;
13--POST--
14-----------------------------240723202011929
15Content-Disposition: form-data; name="entry"
16
17entry box
18-----------------------------240723202011929
19Content-Disposition: form-data; name="password"
20
21password box
22-----------------------------240723202011929
23Content-Disposition: form-data; name="radio1"
24
25test 1
26-----------------------------240723202011929
27Content-Disposition: form-data; name="checkbox1"
28
29test 1
30-----------------------------240723202011929
31Content-Disposition: form-data; name="choices"
32
33Choice 1
34-----------------------------240723202011929
35Content-Disposition: form-data; name="choices"
36
37Choice 2
38-----------------------------240723202011929
39Content-Disposition: form-data; name="file"; filename="info.php"
40Content-Type: application/octet-stream
41
42<?php
43phpinfo();
44?>
45-----------------------------240723202011929--
46--FILE--
47<?php
48error_reporting(0);
49print_r($_POST);
50print_r($_FILES);
51?>
52--EXPECTF--
53Array
54(
55    [entry] => entry box
56    [password] => password box
57    [radio1] => test 1
58    [checkbox1] => test 1
59    [choices] => Choice 2
60)
61Array
62(
63    [file] => Array
64        (
65            [name] => info.php
66            [type] => application/octet-stream
67            [tmp_name] => %s
68            [error] => 0
69            [size] => 19
70        )
71
72)
73