I just need to place a <? include_once ("SOMETHING.PHP"); ?>
inside a div. Every time I put the include_once in the div, the SOMETHING.PHP won't show inside the div!! it will end up outside of the div!
here is my div CSS code:
#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;
}
and this is how I put the include_once inside the div:
<div id="bcg"><?php include_once("something.php");?></div>
I don't know what I am doing wrong!! any help would be appreciated.
This is something.php
<?php
$username="";
$password="";
$database="";
mysql_connect('localhost',$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM pages";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
?>
<?php
$i=0;
while ($i < $num) {
$f1=mysql_result($result,$i,"pagebody");
?>
<table width="350" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="76">
<font face="Arial, Helvetica, sans-serif"><?php echo $f1; ?></font>
</td>
</tr>
</table>
<?php $i++; } ?>
Try catching the output from the included script in an output buffer, and then echoing it.
<div id="bcg">
<?php
ob_start();
include_once("something.php");
echo ob_get_clean();
?>
</div>