Php code for button link

I'm trying to put a button [that will redirect to the home page] inside a .php file that comes as a result of a submit form.

The php file is this:

    echo "\nNew record has ID: " . $last_id;
    echo "Error 1: " . $sql . "
" .mysqli_error($conn); } // echo(""); // this is a test I did before and didn't work $conn->close(); ?>

I 've tried making this an .html file and put inside the php code, but didn't work.
I saw that you can place html code inside a php file, but this doesn't seem to work either. I've also tried it without the div tag, and also tried putting html and body tags, too.
The database works fine btw, it updates normally, I just can't seem to make the html code appear.

What am I doing wrong?

There are several ways of creating an HTML button, that acts like a link (i.e., clicking on it the user is redirected to the specified URL). You can choose one of the following methods to add a link to the HTML button.

You can add an inline onclick event to the