A few points to be made here. First and foremost, what Installer said, it's very imporant. To be honest I don't think he quite stressed it well enough, it should read.
But one thing: don't write code as if "register_globals" is on ...
Now, let's take a look at the first part of your script. You're reading the contents of the directory into an array and then iterating through the array, this can be done in one step and a)avoid passing through the data more than once, also b) save on memory (all be it a very small amount) by not storing the file names in a filename. Also, your syntax for the if statement is wrong, it's not if([condition]) then, it's if([condition]) {. Lastly, $arr[0] will only hold the part of the filename before the dot as you've done a [man]split()[man] on th filename. Have a look at the code below.
<?php
//The menu section based on files available
//open the current directory
$directory = opendir('./cont');
while ($file = readdir($directory))
{
$arr = split('.', $file);
if($arr[1]=='php') {
echo('<a href="index.php?page='.$file.'">'.$file.'</a><br />');
}
}
//The result that should be run in the main <Div>
//I didn't mention this bit above but it is important to check whether or not th file exists.
//It is also important to analyse the structure of $_GET['page'] a little more a well.
//Consider what would happen if $_GET['page'] contained '../../../secretfile'
if(!$_GET['page'] || !file_exists('./cont/'.$_GET['page'])) {
include('./cont/default.php');
} else {
include('./cont/'.$_GET['page']);
}
?>