奇怪的问题谁来答 大家好,请问你们有过这种经历么.用一个PHP文件file_get_contents()一个模板文件,echo出来后发现位置不是原来的居中了,成了靠左了.是怎么回事?我初步判断了一下,是PHP文件头有几行include_once()代码惹的祸.把include_once屏蔽掉就好了.是怎么一回事呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 上代码。你的include_once()怎么写的? 那只能说明你所include的文件中有css样式,才会令你的页面布局改变 引入后 的模版文件 是在php的一个变量里, 也许找不到css了 news.php文件<?phpinclude_once 'inc/cla.connect_db.php';//没有include_once时在IE6中是正常的.有的时候只有在IE6的时候不正常$html=file_get_contents('tpl/news.tpl');$newscates='1';$curpostion='2';$mainContent='3';$html=str_replace('{$newscates}',$newscates, $html);$html=str_replace('{$curposition}',$curpostion, $html);$html=str_replace('{$mainContent}',$mainContent, $html);echo $html;?>include_once里的文件 就是一个连接数据库的类,自己写的.<?phpclass connect_db{private $host;private $name;private $pass;private $db;private $query;private $result; function __construct($host,$name,$pass,$db){ $this->host=$host; $this->name=$name; $this->pass=$pass; $this->db=$db; $this->connect(); }function connect(){ mysql_connect($this->host,$this->name,$this->pass) or die(mysql_error()); mysql_select_db($this->db) or die ("没有该数据库:$this->db"); mysql_query("SET NAMES 'utf8'");}}$connect_db=new connect_db("localhost","root","","dbdalianwa");?>news.tpl文件http://download.csdn.net/detail/dalianwa/4337836 给出可供测试的 url机器不会出错,出错的只是人 客户端的问题,你只要比较客户端的html源码及css/js等 smarty的compile_dir 路径问题 能不能phpinfo的结果赋给一个变量? 总结2008年十大网络建店系统 100分求助:这样的矩阵怎么输出呢? 询问一些BT相关技术?请大大帮忙。 把一个字符串类型数据转成整型怎么转? 为什么我无法用php加载aspell-15.dll? global的问题 讨论:文本数据库的弊端??大家进来探讨! 新手问题! PHP5不支持HTML混编吗?各自错误啊,求教~~~ 求助,我后台有一个无限级分类树菜单表,我在前台调用此表,怎么才有级数地调用出来
你的include_once()怎么写的?
news.php文件<?php
include_once 'inc/cla.connect_db.php';
//没有include_once时在IE6中是正常的.有的时候只有在IE6的时候不正常
$html=file_get_contents('tpl/news.tpl');$newscates='1';
$curpostion='2';
$mainContent='3';
$html=str_replace('{$newscates}',$newscates, $html);
$html=str_replace('{$curposition}',$curpostion, $html);
$html=str_replace('{$mainContent}',$mainContent, $html);echo $html;
?>
include_once里的文件 就是一个连接数据库的类,自己写的.<?php
class connect_db{
private $host;
private $name;
private $pass;
private $db;private $query;
private $result; function __construct($host,$name,$pass,$db){
$this->host=$host;
$this->name=$name;
$this->pass=$pass;
$this->db=$db;
$this->connect();
}
function connect(){
mysql_connect($this->host,$this->name,$this->pass) or die(mysql_error());
mysql_select_db($this->db) or die ("没有该数据库:$this->db");
mysql_query("SET NAMES 'utf8'");
}}
$connect_db=new connect_db("localhost","root","","dbdalianwa");
?>news.tpl文件
http://download.csdn.net/detail/dalianwa/4337836