I have a contact form which has some Turkish text inputs. Character liks “ş” “ı” “ğ” and “ç” are not displaying in my DB correctly. Instead I am getting bunch of weird characters. Meta charset is UTF8 o n the form page but I don’ t know what I am missing here. Any suggestions?
No I haven’t. I have just triple checked everything and it all seems normal. I have set the DB and all of its tables utf8_turkish_ci it is driving me insane…
What I would do is to try to test one by one… I would try to use the command prompt screen to insert a short text into the database. Then I would query it (from the same screen) and check if that looked OK.
No chance. I have tried every single solution I could find yet nothing worked. My current config is:
General Setting on PHP My Admin: Server Connection Collation: utf8mb4_turkish_ci
Meta Tag of the form page:
My PHP script: $headers = “MIME-Version: 1.0” . “\r\n” .
“Content-type: text/html; charset=UTF-8” . “\r\n”;
return mail($_MY_EMAIL_ADDRESS,$subject,$body,$headers);
}
All my tables and columns are also in utf8mb4_turkish_ci
I have tried it before but maybe I have made a mistake. Would you do me a huge favor and take a look at the attached file? I would really appreciate if you could quickly scan through the scripts and let me know what I am missing.
Thanks. I will make the changes right now. Also, another forum member had suggested that I should use prepared statements, I guess that is really important for the security of the DB right? Currently but I am using mysqli to connect to the DB.
Hey, I am sort of familiar with the concept and since I have come this far I may as well implement it. It will take a while to put everything in its place but I will do it. Thanks for the reply.