我想将realation中的网站内容更改为exmaple:的URL中的GET变量
www.example.com/index.php?a=products
www.example.com/index.php?a=contact
我的网站包含3个区块:
- 导航仪
- 左闭塞
- 右侧块
动态的区块是正确的。使用require/include是不可能的,因为这不是我打印的第一件事,然后我可能会收到一个已经发送的标题错误。
<?php
echo "Navigator will be printed here";
echo "Left block will be printed here";
require 'dynamic_content.php';
那么我该怎么做呢?
重新设计项目结构(推荐)或使用输出缓冲功能:
<?php
ob_start();
echo "Navigator will be printed here";
echo "Left block will be printed here";
require 'dynamic_content.php';
ob_end_flush();