I'm working on a basic template script for a friends web site.
this is what i've conjured so far (as an example of part of it);
PHP Code:
<?php
$page = $_GET['page'];
$link = "content/".$page."/title.txt";
if (!include($link)) { // line 9
include('$link'); // line 10
} else {
include('content/home/title.txt');
}
?>
The problem is if $page (which receives it's value from the URL) is invalid or undeclared then I get 4 warnings about line 6 and 7 and the content of the 'else' isn't executed.
I don't know how to make the 'if' any more graceful. What can I do?
Last edited by nat : 07-09-2004 at 01:55 PM.
Reason: typo
|