apache 的 httpd.conf 
AddDefaultCharset gb2312
重启web服务器

解决方案 »

  1.   

    也可以在<head></head>之间加入
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
      

  2.   

    修改页面的<meta>元素如下:
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
      

  3.   

    如果服务器只放html文件,则做以下修改: httpd.conf中: 1)# DefaultLanguage nl 改为: 
    DefaultLanguage zh-cn2)增加: 
    AddLanguage zh-cn .cn3)AddDefaultCharset ISO-8859-1 改为:
    Adddefault Charset off 
    或者
    AddDefaultCharset GB23124)增加(如果没才加) 
    AddCharset GB2312 .gb2312 .gb 如果还要提供PHP,还要修改: php.ini中: 
    ;default_charset = "gb2312" 
    注意这里是注释掉此行,做了以上修改,目的是为让浏览器根据网页头中的charset来自动选择语言,这样就可以在同台服务器上提供多种语言的网页服务。 记住:所做修改后,要重起服务器!
      

  4.   

    huoshelf(Allul)你好:
    我按照你教我的方式改了后,又出现了新的问题:可以显示汉字了。
    但与数据库联接的地方出现了警告,在此之前我的数据库内容是可以通过php页面显示的:Warning: mysql_connect(): Access denied for user: '[email protected]' (Using password: YES) in C:\Program Files\Apache Group\Apache2\htdocs\Net\while.php on line 8Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in C:\Program Files\Apache Group\Apache2\htdocs\Net\while.php on line 10Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\Program Files\Apache Group\Apache2\htdocs\Net\while.php on line 12
    地址  Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in C:\Program Files\Apache Group\Apache2\htdocs\Net\while.php on line 18
      

  5.   

    连接数据库的用户名,密码错误 或者看看MYSQL有没有当了