I have a very simple PHP code that is supposed to output "Hi" as soon as the button is pressed. It works perfectly fine the first time I open the page - there is only one button on the page, I press it and get "Hi" The problem comes when I try to refresh the page. The "Hi" does not disappear.
I tried several browsers and refreshed pages without using cash. This doesn't help. The only thing that helps is opening the page in a new tab. Then there is no "Hi" - until I press the button for the first time.
<form method="post">
<input type="submit" name="test" id="test" value="RUN" /><br/>
</form>
<?php
function testfun()
{
echo 'Hi ';
}
if(array_key_exists('test',$_POST)){
testfun();
}
?>