Php <;?在一个分区中包含一次?
我只需要在div中放置一个Php <;?在一个分区中包含一次?,php,html,css,Php,Html,Css,我只需要在div中放置一个。每次我在div中放置include\u一次,SOMETHING.PHP就不会显示在div中!!它将结束在div之外 这是我的div CSS代码: #bcg { -moz-border-radius:10px; /* for Firefox */ -webkit-border-radius:10px; /* for Webkit-Browsers */ border-radius:10px; /* regular */ border-c
。每次我在div中放置include\u一次,SOMETHING.PHP就不会显示在div中!!它将结束在div之外
这是我的div CSS代码:
#bcg {
-moz-border-radius:10px; /* for Firefox */
-webkit-border-radius:10px; /* for Webkit-Browsers */
border-radius:10px; /* regular */
border-color:#000;
opacity:0.5; /* Transparent Background 50% */
background-image:url(imgs/gray_jean.png);
height:500px;
width:450px;
margin-left:20px;
margin-top:15px;
}
这就是我如何将include_放入div的方式:
<div id="bcg"><?php include_once("something.php");?></div>
尝试在输出缓冲区中捕获包含脚本的输出,然后对其进行回显
<div id="bcg">
<?php
ob_start();
include_once("something.php");
echo ob_get_clean();
?>
</div>
以及something.php
中有什么内容?您能发布您试图包含的php吗?您是否调用include_一次(“something.php”)代码>还有其他地方吗?如果它的内容总是正好打印在这个位置,那么您可能需要调用incldue(…)
。使用提供的内容编辑您的问题。注意:mysql\uu
函数已被删除。请实现mysqli
或pdo
。
<div id="bcg">
<?php
ob_start();
include_once("something.php");
echo ob_get_clean();
?>
</div>