How do I clean this so users can\'t pull pages outside of the local domain?
The safest way is to whitelist your pages:
$page = 'home.php'; $allowedPages = array('one.php', 'two.php', ...); if (!empty($_GET['page']) && in_array($_GET['page'], $allowedPages)) $page = $_GET['page']; include $page;