doudie2693 2014-01-28 14:53
浏览 30

包括不同的页面

I've been trying to figure this one out for awhile, but since i can't find the solution im hoping someone could help me with this.

I made a website, in which there are at the moment 3 different menu options, home contact and an orderpage. Which are in different subfolders. I have index.php in the main folder, and from there on i have a folder named includes and layout. In includes i have the contact.php, orderpage.php. And in layout i have the .css and the menu.php for example.

Now i need to use the include 'something.php'; to include all the pages i need. So you don't get redirected to another page it will just include a different page each time you click another option in the menu.

i hope my question is clear, if not please tell me what i should include.

  • 写回答

2条回答 默认 最新

  • doukezi4576 2014-01-28 15:04
    关注

    From the question it Reads like that: You try to load all Pages at Once and then simply switch between them.

    Problem: PHP doesnt work Like that. Dynamic Content on already loaded Pages can only be handled with Javascript. PHP is only run Server side and all the Code has already run, after you enter a Page.

    What you indeed can do, is loading all Content at once in seperate Div Containers and then simply Switching them by Hiding showing them. But you realy should do a Seperate Page for each of your Pages. So onclick you Switch to the correct Page. If you load a PHP Page, you only use the Code you want for this Page. Dont worry about loading Template Files like css or Images new. On the first Access to a Webpage, the User downloads all Files, if they dont Change, he has them already.

    评论

报告相同问题?

悬赏问题

  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源
  • ¥15 安卓JNI项目使用lua上的问题
  • ¥20 RL+GNN解决人员排班问题时梯度消失
  • ¥60 要数控稳压电源测试数据
  • ¥15 能帮我写下这个编程吗
  • ¥15 ikuai客户端l2tp协议链接报终止15信号和无法将p.p.p6转换为我的l2tp线路