hmm... I'm not sure if that will work though, since index.php will be including itself (infinite loop?)
This could be a possible alternative:
<?php
if (isset($_GET['file'])) {
if (file_exists($_GET['file'])) {
include($_GET['file']);
//exit so we dont go on to the index.php html code itself
exit;
}
}
//the html code and other index.php specific code
?>
of course it makes the assumption that the 'Link' is located in the current directory, or is specified in full.
If your aim is to substitute ?file=link for separate pages, and the files to be included have a .php extension, then it would be safer to use:
<?php
if (isset($_GET['file'])) {
if (file_exists('./' . $_GET['file'] . '.php')) {
include('./' . $_GET['file'] . '.php');
//exit so we dont go on to the index.php html code itself
exit;
}
}
//the html code and other index.php specific code
?>