I'm trying to setup a simple php code that will read .txt files. I want the links to change $x to the desired .txt file, then print the results below the navigation. The code works if i predefine $x, but i want to make it where clicking the links defines $x.
I have no idea where to go from here.
<a href=" $x= a.txt "> a </a>
<a href=" $x= b.txt "> b </a>
<?
$xh = fopen($x, 'r');
$theData = fread($xh, filesize($x));
fclose($xh);
echo '<h1>$x</h1>';
echo $theData;
?>