php for another languages [Solved]

Problems with the Windows version of XAMPP, questions, comments, and anything related.

php for another languages [Solved]

Postby mariam » 21. February 2012 17:30

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?
mariam
 
Posts: 2
Joined: 21. February 2012 17:11
Operating System: windows

Re: php for another languages

Postby Altrea » 21. February 2012 18:33

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,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8288
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: php for another languages

Postby mariam » 26. February 2012 15:33

problem solved
mysqli_query( $connection,"SET NAMES 'cp1256'" );
thanx alot
mariam
 
Posts: 2
Joined: 21. February 2012 17:11
Operating System: windows


Return to XAMPP for Windows

Who is online

Users browsing this forum: milaz357 and 55 guests