0

I am building a form using PHP and I want the user to login with his Arabic name. I have set the database to UTF-8 and the column to UTF-8.

And I have enter the following code in my PHP script:

header('Content-Type: text/html; charset=UTF-8');

And when I output the result it is written in arabic, so no junk letters ...

Why it doesn't log me in when I use arabic username and when I use english username it logs me in?

FarrisFahad
  • 313
  • 1
  • 4
  • 16

1 Answers1

0

A few things to check:

  1. What is your database encoding? Maybe you input is utf-8, but it has been transformed into something else :)
    1. Check your framework (if you are using any) - maybe there is a build in mechanism to transform this
    2. Do you use mysqli to connect? I bet you do - try PDO instead
    3. There is a small discussion here about similar topic: log in with Arabic characters
Community
  • 1
  • 1
Bogo
  • 678
  • 1
  • 5
  • 15
  • my database encoding is UTF-8. When I out put the username in login script, the arabic characters are shown correct, so there is no problem there. But I can't login with an Arabic username, on the other hand, it works great with English username. What do you think is the problem? – FarrisFahad Sep 13 '16 at 18:02