But the included file is on top of the page. I want the output in between myDivID. Do I have an error in the php script or does the include always put it on top of the page?

但是包含的文件位于页面顶部。我想在myDivID之间输出。我在php脚本中是否有错误,或者包含总是将它放在页面顶部?

2 个解决方案

#1


1  

This one is correct

这个是正确的

echo '<div id="myDivID">';
    include 'search.php';
echo '</div>';

#2


2  

<div id="myDivID">
    <?php require_once('search.php'); ?>
</div>

#1


1  

This one is correct

这个是正确的

echo '<div id="myDivID">';
    include 'search.php';
echo '</div>';

#2


2  

<div id="myDivID">
    <?php require_once('search.php'); ?>
</div>
标签:

相关文章