Answers for "get the current datetime in php when button is clicked"

PHP
0

get the current datetime in php when button is clicked

<h2>Click</h2>
<form action="" method="POST">
    <button name="click" class="click">Click me!</button>
</form>

<?php
if(isset($_POST['click']))
{
    $date_clicked = date('Y-m-d H:i:s');;
    echo "Time the button was clicked: " . $date_clicked . "<br>";
}
?>
Posted by: Guest on September-08-2021

Code answers related to "get the current datetime in php when button is clicked"

Browse Popular Code Answers by Language