ajax + POST method - sending PHP an array |
[eluser]nikefido[/eluser]
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: Code: ajax.send("email[][email protected]&email;[][email protected]&email;[][email protected]"); 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 Code: $this->input->post('email'); I am using: Code: ajax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); I was hoping someone might shed some light on the matter.
[eluser]nikefido[/eluser]
more info: Code: doing print_r($_POST) yields: Code: ( 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.
[eluser]nikefido[/eluser]
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 |
Welcome Guest, Not a member yet? Register Sign In |