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 关于#java#的问题:找一份能快速看完mooc视频的代码
  • ¥15 这种微信登录授权 谁可以做啊
  • ¥15 请问我该如何添加自己的数据去运行蚁群算法代码
  • ¥20 用HslCommunication 连接欧姆龙 plc有时会连接失败。报异常为“未知错误”
  • ¥15 网络设备配置与管理这个该怎么弄
  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题