This question already has an answer here:
Hi I am trying to submit arabic data to mysql using forms I ve already sat up all the columns of tables that should be in arabic to u8_general_ci when I save data through phpmyadmin it's well saved and retrieved well but when I submit it through form the data saved as question marks "?????" although I used all of theses
<form action="" method="post" accept-charset="utf-8" >
header("Content-Type: text/html;charset=UTF-8");
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
what could be the solution thanks in advance :)
</div>
Make sure to set the connection character set, run the following:
//PDO example
$dbh->exec('SET CHARACTER SET utf8');
Use the HTML5 pattern attribute.
Use this for Arabic : pattern=[أ-يa-zA-Z]
Example:
<input type="text" name="fname" pattern=[أ-يa-zA-Z] placeholder="Type your name">