err... you have to understand an important thing first:
PHP is executed server side and it outputs HTML to the client.
JavaScript is executed client side (and only there).
So, you cannot change PHP variables in JavaScript statements. It's impossible.
But there are other ways to go:
<a href="<?=$_SERVER['PHP_SELF']?>?file=file-no1.php">Load File 1</a><br>
<a href="<?=$_SERVER['PHP_SELF']?>?file=file-no2.php">Load File 2</a><br>
<?php
if( isset($_GET['file']) )
{
include( $_GET['file'] );
}
?>
this way the page does a reload if you klick on the links... it submits another url parameter that contains the filename.
caution: it's dangerous to include files by an url argument. you shouldn't do this without a check on the paramter first, because someone could try to do something evil with it by manipulating the parameter g