PHP Chinese garbled
A simple database insertion interface and background
Add.html
Backstage add.php
$workcontent = $_request["Workcontent"];
$contact = $_request["Contact"];
$remark = $_request[' remark ');
Include ' conn.php ';
$sql = "INSERT into workcontenttable (Workcontent,contact,remark) VALUES (' $workcontent ', ' $contact ', ' $remark ')";
$issuccess = @mysql_query ($sql);
if (!issuccess) {
echo "Add not successful! ";
}else{
$str = "added a piece of data, business content:" + $workcontent + ", contact person:" + $contact + ", notes:" + $remark;
Echo $str;
}
?>
MySQL encoding is the default Utf-8
Operation in Firefox browser, MySQL normal display for Chinese
Operation in IE, MYSL Chinese garbled
add.php?workcontent= Test &contact=test&remark=ss
Firefox and IE both echo out garbled
My PHP Novice This Chinese garbled problem really tangled
All the methods I've tried on the internet are useless. iconv function after transcoding to empty string PHP MySQL
Share to:
------Solution--------------------
Have encountered similar problems, do not understand the reasons, I was so
$charTest;
if ($tag = = = Iconv (' UTF-8 ', $c, Iconv ($c, ' UTF-8 ', $tag))) {//conversion encoding is not equal