Hey ppl, i got a script that grabs a file and prints it. I made a post about displaying the contents of a file before, but i needed to use PHP in the files. Anyway, i changed the bit that opened it to just include(), but ran into a little problem. When it includes the page, it doesn't display it where i want it to... this is the script:
Code: Select all
if (isset($_REQUEST['page']))
{
$inc = "pages/".$_REQUEST['page'].".php";
if (!file_exists($inc))
{
$content = "Page not found";
}
else
{
$content = include($inc);
}
}
else
{
$content = include("pages/main.php");
}
It displays it at the top of the page, but i have another include in there to display navigation.php, which works fine..(in the correct place). Where i want that to display i just have echo $content;.
Also a weird thing i noticed, where the content should be displayed, it says "1" and nothing else.
Can someone help me with this ?
Thx in advance