PHP
header("Content-Type: text/html;charset=gb2312");
或者
header("Content-Type: text/html;charset=utf-8");
代码
//echo "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>";
echo "<script type='text/javascript'>alert('添加成功');</script>";
echo "<script>history.back();</script>";
exit;
HTML
<meta http-equiv="content-type" content="text/html; charset=UTF-8">