well with that code, $page will always have a value because you are assigning it "pages/.txt" even if there is no $_GET['p'] variable defined.
try this:
PHP Code:
<?php
$p = $_GET['p'];
if( !isset($p) ){
$page = "pages/Home.txt";
}else{
$page = "pages/$p.txt";
}
if( file_exists($page) ){
include($page);
}else{
print("<tr><td class=\"base\" colspan=\"2\">AN ERROR HAS OCCURRED!</td></tr>");
}
?>