Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

127
Visualizações
Putting DateTime into a variable on link click

Im trying to store the datetime when a link is clicked so that later when a form is filled in, the variable is passed to a crud.php file to update information along with the time the link was clicked. Everything is working except I cannot seem to just get the datetime of the link being pressed. I've tried putting it into a for the on click and i feel it should be simple but I cannot seem to get it!

Example Link Code

<a href="http://examplelink/index.php" target="_blank" rel="noopener noreferrer" onclick="myFunction();">
<h2>Webpage One</h2>
<p>This link will open the website in a new tab. Please ensure you close this website, and not the survey website once you no longer require it.</p>
</a>

Example Script on the same .php file

<script>
function myFunction() {
  <?php
  if ($startdate == null) {
    $startdate=date('Y-m-d H:i:s');}
    ?>
}
</script>
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda