I've just uploaded a website I'm making which was working fine on my PC using XAMP. Now it's online I'm having a strange issue where an included page doesn't show unless I first load it separately in my browser first.
Here's an example, this is my index.php:
$content="/main.html.php";
include $root . $template;
And the template file has some html content and then this:
<?php include $content;?>
The html in the template file shows fine, but the $content ("main.html.php") is not shown. But if I open a new browser tab and load main.html.php separately, close that tab, and then go back to the website and refresh the page suddenly the main.html.php content is shown.
What could be the problem here?