Search
 
SCRIPT & CODE EXAMPLE
 

PHP

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>";
}
?>
Comment

PREVIOUS NEXT
Code Example
Php :: worpdress pods taxonomy get custom field 
Php :: magento2 get full details of order collection using root script 
Php :: if user name is wordpress 
Php :: ?? Null Coalescing Operator PHP 
Php :: get current locale laravel 
Php :: if exists in string count php 
Php :: laravel observer get old value 
Php :: laravel blade fontawesome 
Php :: eloquent batch insert 
Php :: Use DateTime() and DateInterval() Objects for PHP 5.3 and Above and Calculate the Difference Between Two Dates Using PHP 
Php :: symfony messenger config 
Php :: export mysql data to word in php 
Php :: laravel ecommerce 
Php :: Laravel nova resolveUsing 
Php :: violation: 1071 Specified key was too long; max key length is 1000 bytes 
Php :: laravel Form::hidden 
Php :: wordpress nav menu align right 
Php :: html in php function 
Php :: php add to array 
Php :: Remove .php extension & Remove trailing slash 
Php :: remove blank data in multidimention array in laravel 
Php :: laravel 8 validation unique 2 columns 
Php :: php conditionals 
Php :: carbon if date is today 
Php :: laravel function 
Php :: how to run curl command through php script 
Php :: PHP strip_tags — Strip HTML and PHP tags from a string 
Php :: Predefined Constants php 
Php :: PHP: How to remove specific element from an array? 
Php :: Laravel route not calling function of controller 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =