[ create a new paste ] login | about

Link: http://codepad.org/EtqXSGrH    [ raw code | output | fork ]

PHP, pasted on Oct 25:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php

$array = array(
    'type' => 0,
    'content' => array(
        'msg_id'    => 'XSS120',
        'source'    => 0,
        'dest'      => 4,
        'type'      => 0,
        'msg'       => 'message'
    )
);

echo "Desired output:\ntype=0&content[msg_id]=XSS120&content[source]=0&content[dest]=4&content[type]=0&content[msg]=message";

echo "\n\nActual output (unencoded):\n";
echo urldecode(http_build_query($array));

echo "\n\nActual output (encoded):\n";
echo http_build_query($array);


Output:
1
2
3
4
5
6
7
8
Desired output:
type=0&content[msg_id]=XSS120&content[source]=0&content[dest]=4&content[type]=0&content[msg]=message

Actual output (unencoded):
type=0&content[msg_id]=XSS120&content[source]=0&content[dest]=4&content[type]=0&content[msg]=message

Actual output (encoded):
type=0&content%5Bmsg_id%5D=XSS120&content%5Bsource%5D=0&content%5Bdest%5D=4&content%5Btype%5D=0&content%5Bmsg%5D=message


Create a new paste based on this one


Comments: