Skip to main content

Bug Tracker

Side navigation

#4751 closed bug (invalid)

Opened June 12, 2009 07:12AM UTC

Closed June 16, 2009 01:30AM UTC

Post array data to server

Reported by: zhuzhe Owned by:
Priority: trivial Milestone: 1.4
Component: ajax Version: 1.3.2
Keywords: post data array Cc:
Blocked by: Blocking:
Description

I was trying to send a data in array format with post function.

var url = 'proc.php';

var data = {'data':[1,2,3,4,5]};

$.post(url,data);

php got

$_POST['data'] = 5;

instead of

$_POST['data] = array(1,2,3,4,5);

I know that

var data = {'data[]':[1,2,3,4,5]};

works for my destination.

but i really don't want write that kind of code.

and sending a string like

"data=1&data=2&data=3&data=4&data=5"

to server is meaningless,right?

Attachments (0)
Change History (1)

Changed June 16, 2009 01:30AM UTC by dmethvin comment:1

resolution: → invalid
status: newclosed

This is not a bug report. Please ask for help on a jQuery or PHP forum.