Either redesign your project structure (recommended) or use Output Buffering functions:
<?php
ob_start();
echo "Navigator will be printed here";
echo "Left block will be printed here";
require 'dynamic_content.php';
ob_end_flush();
Question
I would like to change the site content in realation to a GET variable from the URL for exmaple:
www.example.com/index.php?a=products
www.example.com/index.php?a=contact
My site contains 3 blocks:
The block that would be dynamic is the right one. Using require/include is impossible because it's not the first thing I print and then I'll probably get a headers already sent error.
<?php
echo "Navigator will be printed here";
echo "Left block will be printed here";
require 'dynamic_content.php';
So how can I do that?
Pas de solution correcte
Autres conseils
Either redesign your project structure (recommended) or use Output Buffering functions:
<?php
ob_start();
echo "Navigator will be printed here";
echo "Left block will be printed here";
require 'dynamic_content.php';
ob_end_flush();