View Single Post
Old 10-19-2004, 05:41 PM   #9 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,544
sde is on a distinguished road
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>");
}

?>
__________________
Mike
sde is offline   Reply With Quote