If you are using a question mark in front of PHP_SELF that would be a problem. It would work better something like this:
<a href="<?php echo $PHP_SELF.'?includefile=file.php'?>"
Your script assumes globals are turned on, it sould really look more like this:
<a href="<?php echo $_SERVER['PHP_SELF'].'?includefile=file.php'?>"
Except that would allow anybody to include whatever script they felt like running on your server (including remote ones), so it should really look more like this:
<a href="<?php echo $_SERVER['PHP_SELF'].'?includefile=file'?>"
<?php
if (isset($GET['includefile']))
{
$includefile=$GET['includefile'].'.php';
include '$includefile';
}
?>
That script assumes there are no files in that directory that you would not want the user to be able to access. If there are, you would need to take a few more precautions.
EDIT: Actually, my modification would still be unsecure, it should really look more like this:
<?php
if (isset($GET['includefile']))
{
$includefile=$GET['includefile'];
if ($includefile=='file') include 'file.php';
}
?>
If you have a lot of files, it might be better to use a switch statement.