例如在浏览器地址是:http://www.xxx.com?m=quoted_price&s=qpdetail&id=814159&tcatid=35&model=WS-800S&comp=上氯申峰获取参数
 $company='$_GET[comp]'
然后输出
 echo $company 有时得到“上氯申峰”,有时候得到'��������' 这是怎么回事,在IE下经常是乱码,在其它浏览器下多数情况下是正常的问题出在哪里,在线等待

解决方案 »

  1.   

    顶上加这么一句,设置一下统一编码
    <meta charset=utf-8>你的参数获取也太不规范了
    用  $company=$_GET["comp"];
      

  2.   

    通常在 IE 高级卡中勾选 总是以UTF-8发送URL 可缓解此现象
      

  3.   

    php:header("content-type:text/html;charset:utf-8");
    html:<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />utf-8是编码,根据你自己使用的编码自行改动
      

  4.   

    不行啊,
    请大家访问这个看看
    http://www.engplast.cn/?m=quoted_price&s=qpdetail&id=814172&tcatid=21&model=T30S&comp=武汉凤凰如果能看到曲线应该是正常的,看不到说明得到的是乱码
      

  5.   

    那是个flash,你是如何知道是乱码了的
      

  6.   

    输出的sql语句啊select price,time from price where tcatid='21' and model='T30S' and company='�人����' and `time` >=1338220800 order by time 
      

  7.   

    flash是没问题的,如果获得的不是乱码是可以看到图的,因为乱码就没有数据输出了
      

  8.   

    浏览器问题... Linux下 Chromium表示淡定
      

  9.   

    我晕
    <a href="?m=quoted_price&amp;s=qpdetail&amp;id=814172&amp;tcatid=21&amp;model=T30S&amp;comp=武汉凤凰" target="_self">查看趋势图</a>这么写就没问题
    <a href="?m=quoted_price&amp;s=qpdetail&amp;id=814172&amp;tcatid=21&amp;model=T30S&amp;comp=武汉凤凰" target="_blank">查看趋势图</a>这样就有问题,是什么原因大家帮我看看
      

  10.   

    为什么要用 上氯申峰 这种格式? urlencode('上氯申峰')转义成%C9%CF%C2%C8%C9%EA%B7%E5才是标准的写法。
      

  11.   

    <a href="?m=quoted_price&s=qpdetail&id=<{$list.id}>&tcatid=<{$list.tcatid}>&model=<{$list.model}>&comp=<{$list.company}>"><{$list.model}></a>
    对参数comp转义怎么写?
      

  12.   

    <a href="?m=quoted_price&s=qpdetail&id=<{$list.id}>&tcatid=<{$list.tcatid}>&model=<{$list.model}>&comp=<{$list.company|urlencode}>"><{$list.model}></a>
    还有 如何给有用的揭底给分啊?
      

  13.   

    换个角度去考虑这个问题。
    生成参数时 encode 一下。
    获取参数时 decode 一下。
    避免编码不同照成麻烦。简单快速的解决问题~