Limit the time in a html and php form

0

In a html and php form, which passes to a mysql db, can you prevent the same user from responding several times? And limit the time to a week, for example? I want that after a given time, one month, (in the example the month of February), the user can no longer cover the form and close it.

<?php
//prueba para limitar la fecha
if (date("m") >=2 && date ("m")<=3);
{
echo "has llegado tarde para cubrir el formulario";
}
else {
    exit;
}
?>

but I have an error:

  

Parse error: syntax error, unexpected 'else' (T_ELSE), expecting end of file in C: \ xampp \ htdocs \ procesaCasaTum.php on line 7

    
asked by Juan Carlos 04.04.2017 в 16:34
source

1 answer

1

The error that is occurring on line 7 is because you are using a (;) at the end of if , I leave the corrected code:

if (date("m") >=2 && date ("m")<=3){
    echo "has llegado tarde para cubrir el formulario";
}else {
    exit;
}
    
answered by 04.04.2017 в 21:49