Form Encoding

1

I have a form on a page that contains the following tag in head

<meta charset="utf-8" />
The form is pointed to the processa.php page and at the top of that page I also put the tag <meta charset="utf-8" />

It turns out that the emails I am receiving from this page processa.php are all with a wrong accent, I have already made several changes and everything is the same. What can it be?

    
asked by anonymous 11.08.2017 / 21:55

1 answer

0

If this code below does not work:

header("Content-Type: text/html; charset=UTF-8", true);

You may need to use another php feature that causes the variable to be encoded in isolation.

Ex.

$nome = utf8_encode($_POST['nome']);

If it does not work try this:

$nome = utf8_decode($_POST['nome']);

If neither of these works, specify which sendmail library you are using in php.

If it's phpMailer you can solve it like this:

$mail->CharSet = 'utf-8';

Hugs!

    
16.08.2017 / 21:33