You have to first grab the $id variable from the URL using the GET function.

Near the top of the page (preferably in the <head> tags) add this:

<?php
$id = $_GET['id'];
$id = $id . ".txt";
?>


Then down where you want the content to be you do the include. The include should be structured this way (assuming the files to be included are something like 1.txt or 2.txt):


<?php
include($id);
?>