mostafatalebi Posted January 1, 2013 Share Posted January 1, 2013 Hello I have to add persian language strings to the database out of a form through PHP. Persian is right to left. I have set sql table to utf8_persian, and when I use SQL direct interface to insert persian data, it works, and in HTML-PHP page I have many persian strings which all smoothly are rendered. But When I get the user data from a from in persian language, and through php mysqli statement want to add them into the table, they are added in strange characters. I also have done mysqli_set_charset($link, "utf8"); What shall I do? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/272575-problem-with-persian-language-in-php-to-mysql/ Share on other sites More sharing options...
Christian F. Posted January 1, 2013 Share Posted January 1, 2013 You have to set the correct HTML and HTTP headers too. Then I'm thinking especially about the "dir" property of the HTML tag. Quote Link to comment https://forums.phpfreaks.com/topic/272575-problem-with-persian-language-in-php-to-mysql/#findComment-1402648 Share on other sites More sharing options...
mostafatalebi Posted January 2, 2013 Author Share Posted January 2, 2013 would you please explain more? this is my heade: <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> Quote Link to comment https://forums.phpfreaks.com/topic/272575-problem-with-persian-language-in-php-to-mysql/#findComment-1402707 Share on other sites More sharing options...
mostafatalebi Posted January 2, 2013 Author Share Posted January 2, 2013 Please Help me I have searched the net but I have not found a working solution. :'( Quote Link to comment https://forums.phpfreaks.com/topic/272575-problem-with-persian-language-in-php-to-mysql/#findComment-1402710 Share on other sites More sharing options...
Christian F. Posted January 2, 2013 Share Posted January 2, 2013 A simple Google search for "html dir attribute" gave me a lot of hits, all of them (at least the first page) relevant. Quote Link to comment https://forums.phpfreaks.com/topic/272575-problem-with-persian-language-in-php-to-mysql/#findComment-1402792 Share on other sites More sharing options...
mostafatalebi Posted January 2, 2013 Author Share Posted January 2, 2013 Thanks Quote Link to comment https://forums.phpfreaks.com/topic/272575-problem-with-persian-language-in-php-to-mysql/#findComment-1402835 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.