'##depth##' ) { //placeholder } $dir_depth = (int)trim(fgets($fp, 256)); $dir_prefix = ''; for($i = 0; $i < $dir_depth; $i++) { $dir_prefix = $dir_prefix.'../'; } $setup_file = $dir_prefix.'include/htmlpage.inc'; include $setup_file; //before I do anything need to load up the .txt file $html = new htmlpage; //create a new htmlpage instance $html->readfile($fp); //now read the .txt file that contains all page info //Note this also sets up all other required objects: //right_menu, top_menu, and main_text for this particular page $html->printpage($dir_prefix); //Now print the page /* And that's it... all of the work is in the htmlpage class and its elements */ ?>