Call PHP function with HTML


This is what I want…
I have a couple of .txt files:

Now i want to make a website with tree buttons and when I click on the first the txt from 1.txt is shown on the screen. When I click on the second the text of 1.txt is still there en the text of 2.txt is shown above it. Can someone help me!!

I’m trying to do this by calling the PHP function from HTML without refreshing it.

This is what I have for now…


<a href="" call inputText("tekst1.txt")>tekst1</a>
<a href="" call inputText("tekst2.txt")>tekst2</a>

function inputText ($vileName) {
$filename = $vileName;
$text = "";
$contents = @file($filename) or die("No files in guestbook.");

foreach ($contents as $line) {
	$text .= $line;

$text = split("<break>", $text);
$text = array_reverse($text); # removing this line will put newest comments at the bottom
for ($i=0; $i<count($text)-1; $i++) {
	echo "<div style=\"border: gray 0px solid; padding: 0px; font-family: arial, sans-serif; background-color: #ffffff;\">";
	echo $text[$i];
	echo "</div>";

Thanks in advance Zeb