dswm97353 2013-11-19 19:36
浏览 37
已采纳

PHP:“require_once”乱序

In my index.php I have:

<?php

require_once('./headers/hed1.php');

require_once('./headers/hed2.php');

require_once('./headers/hed3.php');

echo 'TEXT';

?>

When I run this on my pc (using XAMPP) I get the result I want: the output of the three require_once, and then the TEXT.

I uploaded it to a server, and the same code has a different output. I see first the TEXT, and then the three require_once.

I saw another post of someone with the same problem, but there was no solution. Why the output id displayed in a different way if it's onlyne? Is there a way to "reorder" the three require_once?

Thanks in advanced!

  • 写回答

2条回答 默认 最新

  • dprlv04662 2013-11-19 19:46
    关注

    Everything is OK with your code and it is echoed by the PHP properly, this is the output:

    <table border="0" width=100%><tr><td>Hi!</td><td align=right><a href="index.php?login">Log in!</a>, <a href="index.php?register">Register!</a></td>main
    

    The problem is in your HTML. It's invalid. The table is not closed. The elements are messed up. The browser simply renders it in the wrong order.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化