ajax + POST method - sending PHP an array

Hi all -

I have an ajax function using the POST method, sending POST data via the "send" method.

It is sending a string that resembles:

ajax.send("email[][email protected]&email;[][email protected]&email;[][email protected]");
//CI forums is adding the extra ";" in there!

Basically, we are trying to send PHP an array of emails to send multiple emails as part of a projects functionality.

However, in CI, I am testing for
Both of which seems to coming up as false.

I am using:
ajax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
so I don't believe that's the issue.

I was hoping someone might shed some light on the matter.

what does print_r($_POST) display?

more info:
doing print_r($_POST)

[email] => Array
         [0] => [email protected]

So it appears to be working the way I want it to! (this is a really neat way to pass arrays to PHP)

However, CI is still coming up as FALSE for the POST var existing.

sorry, this is my mistake.

there's another variable being tested for that is not getting send via the ajax call.

so this SHOULD be working just fine.

/hits forehead

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.