If you don't want to maintain a list of valid files, something like this should work (but is untested):
$module = $_GET['module'];
if($module == "") { $module = "Home"; }
if (!preg_match('|^[\\w\\-\\/]+$|', $module)) {
die("Invalid Module.");
}
$module = "/path/to/modules/$module";
if (!file_exists($module . ".php")) {
die("Invalid Module.");
}
else {
require_once($module . ".php");
}
That will only allow $module to contain letters, numbers, underscores, hyphens, and slashes. By disallowing everything else, including dots, it prevents the ".." attack. It also prepends the module directory, so they can't specify relative to root. They can only specify files that are inside your modules directory or a subdirectory of that.