I want to output text once a button is clicked but also have it automatically disappear within a specific time frame. Currently, I have written php code so that the message appears when the button is clicked but I am not sure how to make it automatically disappear within a given time frame. The following is the php code I have:
<?php if (isset($_SESSION['msg'])): ?>
<div class="msg">
<?php
echo $_SESSION['msg'];
unset($_SESSION['msg']);
?>
</div>
<?php endif ?>
$_SESSION['msg] is obtained from another file and its code is shown below:
if (isset($_POST['submit'])) {
$_SESSION['msg'] = "Data Entry Added!";
}