PHP按钮清除HTML文件的内容[关闭]

I have a PHP script which writes information to a HTML file in my directory and I want to be able to view the information and have a button above the information that clears the contents of the HTML file.

What I have done so far is make a PHP file (log.php) which displays the contents of the HTML file (log.html).

What I'd like to know please is how to add a button at the top of log.php (Above the HTML content being displayed) that clears the contents of the HTML file and then refreshes log.php to display the empty HTML file.

I'd really appreciate any input, thanks in advance!

HTML:

<form method="post">
    <input type="submit" name="wipe" value="Wipe Log.html" />
</form>

PHP:

<?php
    if($_POST['wipe']) {
        file_put_contents("log.html","");
    }
?>

HTML

<form method="post">
    <input type="submit" name="clearLog" value="clear" />
</form>

PHP

if(isset($_POST['clearLog']){
    file_put_contents('log.php', '');
}