保证php在文件末尾包含/要求
在我的web应用程序中,有以下页面:保证php在文件末尾包含/要求,php,Php,在我的web应用程序中,有以下页面: <?php require_once('head.php');?> <?php require_once('nav.php');?> <div class="container-fluid"> <div class="container EXAMPLE"> <?php if(isset($_SESSION['lecturer'])){
<?php require_once('head.php');?>
<?php require_once('nav.php');?>
<div class="container-fluid">
<div class="container EXAMPLE">
<?php
if(isset($_SESSION['lecturer'])){
require_once('lecturer-courses.php');
} else{
require_once('student-courses.php');
}
?>
</div>
</div>
<?php require_once('footer.php') ?>
在student-courses.php代码中,最后两行也需要
echo
ed
$output .= '</tbody>';
$output .= '</table>';
然后在你的主页上
<?php
if(!empty($footer_disp))require_once('footer.php')
?>
或者可能只是其中一个包含的文件中未正确关闭的div
标记。能否显示学生课程.php
?可能存在错误,默认情况下php不是异步的,所以即使某些事情需要很长时间,下一个流也不会启动,直到最后一个流结束,就像我看到的松散的div
标记一样。PHP同步执行,因此…在浏览器中打开页面并检查元素,找出它在哪里,与它应该在哪里相关,然后找出需要
的地方,因为我相当确定这就是问题所在:)此外,如果可能的话,您可以显示其他文件的代码吗?我觉得问题在于其中一个!
if(condition met)$footer_disp = FALSE;
else $footer_disp = TRUE;
<?php
if(!empty($footer_disp))require_once('footer.php')
?>