我遇到一个很奇葩的IE兼容问题 归纳一句话就是:本来是跑偏了的,在dreamweaver中找了一段同样的代码替换后就可以了,但把这段代码放在模板里,还是会跑偏,大家有遇到过这种情况没、? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可能是编码问题,或者BOM的问题 在编辑器里选中 无BOM utf-8哪应该怎么去呢? 但是 http://www.bjp51.net 的前20个字节的十六进制内码为efbbbfefbbbf3c21444f43545950452068746d6c而 utf-8 的 BOM 头的十六进制内码为 efbbbf所以你还有两个相关文件的 BOM 头没有去除 echo bin2hex(file_get_contents('http://www.bjp51.net/', false, null, 0, 20));efbbbfefbbbf3c21444f43545950452068746d6c 显然的的主页不是纯 html 文件既然是 php 程序,那么就免不了有 include 的文件被引入的文件本身没有代码输出,所以就把 BOM 头留在页面输出的前面了如果你还有模板文件,那么在输出的 HTML 中间也可能会有 BOM 影响布局 一个个去特别麻烦,有没有一段php代码,让他强制 ROM吗? <?phprequire("inc/conn.php");include("inc/top.php");include("inc/bottom.php");include("label.php");include("zs/subzs.php");include("fly.php");if (isset($_GET['skin'])){$siteskin=$_GET['skin'];}else{$siteskin=siteskin;}$file=dirname(__FILE__)."/template/".$siteskin."/index.htm";$fso = fopen($file,'r');$strout = fread($fso,filesize($file));$strout=str_replace("{#siteskin}",$siteskin,$strout) ;$strout=str_replace("{#sitename}",sitename,$strout) ;$strout=str_replace("{#siteurl}",siteurl,$strout) ;$strout=str_replace("{#pagetitle}",sitetitle,$strout);$strout=str_replace("{#pagekeywords}",sitekeyword,$strout);$strout=str_replace("{#pagedescription}",sitedescription,$strout);$strout=str_replace("{#sitebottom}",sitebottom(),$strout);$strout=str_replace("{#sitetop}",sitetop(),$strout);if (strpos($strout,"{@")!==false) $strout=showlabel($strout);//先查一下,如是要没有的就不用再调用showlabelif (flyadisopen=="Yes") {$strout=str_replace("{#flyad}",Showflyad("漂浮广告"),$strout);}else{$strout=str_replace("{#flyad}","",$strout);}if (duilianadisopen=="Yes"){$strout=str_replace("{#duilianad}",showduilianad("对联广告左侧","对联广告右侧"),$strout);}else{$strout=str_replace("{#duilianad}","",$strout);}echo $strout;?>这是首页的代码,我刚才一个个检查了 发现一个不是去头的rom 我编码后还是不行。 已经解决了,我把4月份到今天的文件全部编码了一次,问题解决了,就是rom的问题,谢谢大家了。 大侠帮帮忙, 不胜感激,请教 如何把做好的网站后台 帝国cms 转换为织梦cms (数据库不变) 关于整合echop和discuz x的问题? QQ空间 是用什么开发的 PHP中一个非常奇怪的问题 WordPress是否可以用SQL语句直接发文章? 求PHP大牛指导提高 phpexcelReader的使用 PHP邮政网银支付,求助 php如何给html页面加水印??求解? 请问ecshop的银联接口(upop)商户密钥怎么获取? 关闭浏览器,销毁session php ios 群体推送
efbbbfefbbbf3c21444f43545950452068746d6c
而 utf-8 的 BOM 头的十六进制内码为 efbbbf
所以你还有两个相关文件的 BOM 头没有去除
既然是 php 程序,那么就免不了有 include 的文件
被引入的文件本身没有代码输出,所以就把 BOM 头留在页面输出的前面了
如果你还有模板文件,那么在输出的 HTML 中间也可能会有 BOM 影响布局
<?php
require("inc/conn.php");
include("inc/top.php");
include("inc/bottom.php");
include("label.php");
include("zs/subzs.php");
include("fly.php");
if (isset($_GET['skin'])){
$siteskin=$_GET['skin'];
}else{
$siteskin=siteskin;
}
$file=dirname(__FILE__)."/template/".$siteskin."/index.htm";
$fso = fopen($file,'r');
$strout = fread($fso,filesize($file));
$strout=str_replace("{#siteskin}",$siteskin,$strout) ;
$strout=str_replace("{#sitename}",sitename,$strout) ;
$strout=str_replace("{#siteurl}",siteurl,$strout) ;
$strout=str_replace("{#pagetitle}",sitetitle,$strout);
$strout=str_replace("{#pagekeywords}",sitekeyword,$strout);
$strout=str_replace("{#pagedescription}",sitedescription,$strout);
$strout=str_replace("{#sitebottom}",sitebottom(),$strout);
$strout=str_replace("{#sitetop}",sitetop(),$strout);
if (strpos($strout,"{@")!==false) $strout=showlabel($strout);//先查一下,如是要没有的就不用再调用showlabelif (flyadisopen=="Yes") {
$strout=str_replace("{#flyad}",Showflyad("漂浮广告"),$strout);
}else{
$strout=str_replace("{#flyad}","",$strout);
}
if (duilianadisopen=="Yes"){
$strout=str_replace("{#duilianad}",showduilianad("对联广告左侧","对联广告右侧"),$strout);
}else{
$strout=str_replace("{#duilianad}","",$strout);
}
echo $strout;
?>这是首页的代码,我刚才一个个检查了 发现一个不是去头的rom 我编码后还是不行。