关于客户端get传输到服务端乱码解决:
<script>//ajakx 传输变量var xmlhttp; if (window.XMLHttpRequest) ?{// code for IE7+, Firefox, Chrome, Opera, Safari ?xmlhttp=new XMLHttpRequest(); ?} else {// code for IE6, IE5 ?xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); ?} xmlhttp.onreadystatechange=function() ?{ ?if (xmlhttp.readyState==4 && xmlhttp.status==200) ??{ ??//此处处理 ?php 处理后返回的结果 ?//alert(xmlhttp.responseText); ???} ?else{ ???????} } xmlhttp.open("GET","index.php?link=link",false); xmlhttp.send(); //ajax END</script>
<?php//服务端接收//将客户端get过来的中文转换成gbk;$link= iconv("utf-8","gbk",$_GET[‘link‘]); ?>
ajax GET 传输中文乱码
原文地址:http://www.cnblogs.com/fan-bk/p/7660638.html