I'm making a little site for a friend, noobfriendly, so she can add pages easy. I think I'm just gonna include everything in index.php. So she can just drop a page in a folder named /pages/ and it's done.
index.php
if (preg_match('/[a-zA-Z]/', $_GET['page'])){
$page = 'pages/'.$_GET['page'].'.php';
if ($page) {
include $page;
} else {
exit;
}
} else {
include('pages/home.php');
}
This is pretty safe right? I'm only allowing letters a-z. I mean it's not gonna be a big site like google. Well I'm just a hobbycoder so I'm asking guys to make sure :)
What do you think?