I’m creating a basic form with ajax submit using jquery framework.
This is my code :
$('form#contact_form').submit(function() {
$.ajax({
type: $(this).attr('method'),
url: $(this).attr('action'),
data: $(this).serialize(),
success: function(data) {
}
});
});
And I use PHP file with simple var_dump($_POST) to show the result.
When I test by interrogating simple PHP page, it’s working perfectly.
When I test by interrogating function from my contact controller on CodeIgniter, all items of my form which are accents (not special chars, only accents like “éàèù”), the item are empty.
For information, all my files have UTF-8 encoding.
Someone will know how I can fix this problem ?
Thanks,
I have found the problem.
Indeed, the CodeIgniter framework process a “cleaning” of input variables into the Input library.
Because I develop from my MAMP server, there is a bug from it. It was necessary to change the charset encoding UTF-8 to utf-8 and it’s working now.
Thanks for your interest.