Still insecure - if anything, even more insecure than the original.
if(file_exists("details/".$_GET['id'].".php")){
include 'details/'.$_GET['id'].'.php';
}
could be used to run any PHP file in the filesystem.
Safer would be to keep an array of allowable pages, and only load the requested page if it is one of those.
$allowable_pages=array('news', 'submit', /*...*/);
if(in_array($_GET['id'], $allowable_pages) && file_exists($_GET['id'].'.php'))
{
include $_GET['id'].'.php';
}
With the existing enhancements for subdirectories as needed. Also, the array need not be hardcoded (though it's worth thinking about for maximum performance), but instead generated by reading through the directory/directories where allowable pages are to be found and seeing what's there.