PHPPOST接收中文字符串会乱码,求大神帮忙看看!急急急!!
我的中文字符编码是全局的,有一个全局页面,在common.inc.php里,我的注册页面调用了common.inc.php,可是以POST方式接收到并打印出来会出现中文乱...
我的中文字符编码是全局的,有一个全局页面,在common.inc.php里,我的注册页面调用了common.inc.php,可是以POST方式接收到并打印出来会出现中文乱码,这该怎么办啊,急!拜托各位大神们了,下面是注册页面的PHP处理代码
header("Content-Type:text/html;charset=UTF-8");
session_start();
define('IN_TG',true);
define('SCRIPT','register');
require dirname(__FILE__).'./include/common.inc.php';
$nmsg='';
for($i=0;$i<7;$i++){
$nmsg .= dechex(mt_rand(0, 15));
}
$_insert = sha1($nmsg);
_login_state();
if(@$_GET['action'] === 'register'){
_check_code($_POST['yzm'],$_SESSION['code']);
include ROOT_PATH.'include/check.fun.php';
$_clean = array();
$_clean['uniqid'] = _check_uniqid($_POST['uniqid'], $_SESSION['uniqid']);
//active也是一个唯一标识符,用来刚注册的用户进行激活处理,方可登陆
$_clean['active'] = _sha1_uniqid();
$_clean['username'] = _check_username(htmlspecialchars($_POST['username']),2,50);
$_clean['password'] = _check_password(htmlspecialchars($_POST['password']),htmlspecialchars($_POST['notpassword']),6);
$_clean['question'] = _check_question(htmlspecialchars($_POST['passt']), 2, 50);
$_clean['answer'] = _check_answer(htmlspecialchars($_POST['passt']),htmlspecialchars($_POST['answer']),2,20);
$_clean['sex'] = _check_sex(htmlspecialchars($_POST['sex']));
$_clean['face'] = _check_face(htmlspecialchars($_POST['face']));
$_clean['email'] = _check_email(htmlspecialchars($_POST['email']),6,40);
$_clean['qq'] = _check_qq(htmlspecialchars($_POST['qq']));
$_clean['url'] = _check_url(htmlspecialchars($_POST['url']),40);
print_r($_clean);
?> 展开
header("Content-Type:text/html;charset=UTF-8");
session_start();
define('IN_TG',true);
define('SCRIPT','register');
require dirname(__FILE__).'./include/common.inc.php';
$nmsg='';
for($i=0;$i<7;$i++){
$nmsg .= dechex(mt_rand(0, 15));
}
$_insert = sha1($nmsg);
_login_state();
if(@$_GET['action'] === 'register'){
_check_code($_POST['yzm'],$_SESSION['code']);
include ROOT_PATH.'include/check.fun.php';
$_clean = array();
$_clean['uniqid'] = _check_uniqid($_POST['uniqid'], $_SESSION['uniqid']);
//active也是一个唯一标识符,用来刚注册的用户进行激活处理,方可登陆
$_clean['active'] = _sha1_uniqid();
$_clean['username'] = _check_username(htmlspecialchars($_POST['username']),2,50);
$_clean['password'] = _check_password(htmlspecialchars($_POST['password']),htmlspecialchars($_POST['notpassword']),6);
$_clean['question'] = _check_question(htmlspecialchars($_POST['passt']), 2, 50);
$_clean['answer'] = _check_answer(htmlspecialchars($_POST['passt']),htmlspecialchars($_POST['answer']),2,20);
$_clean['sex'] = _check_sex(htmlspecialchars($_POST['sex']));
$_clean['face'] = _check_face(htmlspecialchars($_POST['face']));
$_clean['email'] = _check_email(htmlspecialchars($_POST['email']),6,40);
$_clean['qq'] = _check_qq(htmlspecialchars($_POST['qq']));
$_clean['url'] = _check_url(htmlspecialchars($_POST['url']),40);
print_r($_clean);
?> 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询