How to post Arabic characters in PHP
- by Peter Stuart
Okay,
So I am writing an OpenCart extension that must allow Arabic characters when posting data.
Whenever I post ????? the print_r($_POST) returns with this: u0645u0631u062du0628u0627
I check the HTML header and it has this:
<meta charset="UTF-8" />
I checked the PHP file that triggers all SQL queries and it has this code:
mysql_query("SET NAMES 'utf8'", $this->link);
mysql_query("SET CHARACTER SET utf8", $this->link);
mysql_query("SET CHARACTER_SET_CONNECTION=utf8", $this->link);
This is in my form tag:
<form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form" accept-charset="utf-8">
I can't think of what else I am doing wrong. The rest of the OpenCart framework supports UTF8 and arabic characters. It is just in this instance where I can't post anything arabic?
Could someone please help me?
Many Thanks
Peter