I have a button that runs a PHP function after the user onClicks. This is achieved using the POST method (as illustrated below). The user clicks on the button and the PHP function runs correctly, however, I want the user to be able to click the button multiple times and for the function to run multiple time. The function cannot over-ride its last result/outcome (so basically the result is echoed/printed each time the user clicks the button and the previous results are not overwritten).
Here is a section of my code, as follows:
<?php
function onClickArchive($detail_locator){
for ($x = 0; $x <= 34; $x++) {
echo "<li><br />";
kal_generator($detail_locator);
echo "</li>";
}
}
if(isset($_POST['load_more'])){
onClickArchive($detail_locator);
}
?>
</ul>
<div id="reload_section">
<center><br />
<form method="post">
<input type="submit" value="Load More" name="load_more" class="load_more_content" />
</form>
</center>
</div>