0
I have a question. I would like to know how I can do so that the php code stores the time I registered an activity, but it should be hidden in the form and only visible when this data is visible in a table.
?>
<?php require "templates/header.php"; ?>
<?php if (isset($_POST['submit']) && $statement) : ?>
<blockquote> Registrado com sucesso! </blockquote>
<?php endif; ?>
<h2>Registrar Atividade</h2>
<form method="post">
<input name="csrf" type="hidden" value="<?php echo escape($_SESSION['csrf']); ?>">
<label for="nome_atividade">Nome da Atividade: </label>
<input type="text" name="nome_atividade" id="nome_atividade">
<label for="duracao">Duração: </label>
<input type="text" name="duracao" id="duracao">
<label for="descricao">Descrição: </label>
<textarea rows="4" cols="50" name="descricao" id="descricao"></textarea> <br>
<input type="submit" name="submit" class="btn" value="Registrar">
</form>
<a href="registro_de_atividades.php">Voltar</a> <br>
<a href="index.php">Voltar para o meu perfil</a> <br>
<?php require "templates/footer.php"; ?>
Nor need to be hidden in the form, just the server that receives this information save the time along with the form data. You can use the function
date()
. Example:date(""Y-m-d H:i:s"")
– fernandosavio