How to define a minimum time interval between inserts in the database?

1

I have a submission form, where it adds comments to the database and shows them on the page.

The problem is that I want to set the form so that people can only do submissions every 10 minutes. That is, a user can only post a second comment 10 minutes after posting the first one.

How can I do this?

My submission begins like this:

if(isset($_POST['submitPost'])) {

    //mysqli_real_escape_string($db, )

    $postcomment = mysqli_real_escape_string($db, $_POST['message']);
    $uploaded = mysqli_real_escape_string($db, $_POST['upload']);
    $titleID = mysqli_real_escape_string($db, $_POST['title']);

     ...
}

The structure of the comentarios table:

 | id_steam (users) | title | comment | date |
    
asked by anonymous 06.05.2017 / 15:18

0 answers