Bug Tracker

Opened 14 years ago

Closed 14 years ago

#4751 closed bug (invalid)

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:


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]};


php got

$_POSTdata? = 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


to server is meaningless,right?

Change History (1)

comment:1 Changed 14 years ago by dmethvin

Resolution: invalid
Status: newclosed

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

Note: See TracTickets for help on using tickets.