Not the best name for a thread but still…
I got
<?php include('inc/nav_bar.php'); ?>
...
<?php
main code block
?>
I need to print one variable from “main code block” to “nav_bar” block,
is there is any good way to do this ?
The only solution I’ve found so far is to use javascript.
If I understand you correctly your nav_bar.php prints out something which should contain the value of a variable in the main code block.
Then you could try to “catch” the output of the nav_bar.php:
Edit: But I agree with the others. A better solution is to change your code-design and use classes/functions.