Page 1 of 1

php for another languages [Solved]

PostPosted: 21. February 2012 17:30
by mariam
I am a new web developer and I was trying to program a website were users can login typing thier names in any language including Arabic using the Arabic letters but ican't store the names entered by Arabic in the database because they appear as English letters which is incorret but when I try to enter the names manually to the database without using php they appear right.
Should i make changes to the php.ini file?
What should I do?

Re: php for another languages

PostPosted: 21. February 2012 18:33
by Altrea
Hi mariam,
The arabic alphabet is part of the utf-8 charset. So every part of your site (the php-pages, your html forms, the database connection, meta data...) have to be prepared for utf-8.
Fully understanding charsets is not easy stuff, and not easy to teach (especially if english is not the teachers native language).

Use tools like Firebug to proof, if your site is responsed as utf-8 or not. Proof the request and response of your forms. If everything is good there, check your database communication. In most cases you should tell your dbms that the communication has to be in utf-8 (for MySQL simply use the SET NAMES Statement).

best wishes,

Re: php for another languages

PostPosted: 26. February 2012 15:33
by mariam
problem solved
mysqli_query( $connection,"SET NAMES 'cp1256'" );
thanx alot