Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 607989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:25:00+00:00 2026-05-13T17:25:00+00:00

can someone please tell me how to save a javascript rendered countdown timer to

  • 0

can someone please tell me how to save a javascript rendered countdown timer to mysql db using PHP ?
e.g
I have this button, that when someone clicks it, the countdown appears and starts counting.

so yeah, that’s my problem, what’s the best way to do in order to ensure that
– the exact date/time(in unix format) the button got clicked will be saved in db?
is this possible with PHP ?

// this is the PHP and HTML

<?php foreach($task->result() as $row): ?> 
  <tr> 
    <td><a title="<?php echo $row->descr; ?>" 
           href="#"><?php echo $row->title; ?></a>
    </td> 
    <td><input type = "button" 
       id =<?php echo $row->title; ?> 
       value = "Unlocked" 
       onmouseover = "asktolock(this.id)" 
       onclick = "lockme(this.id)">
    </td> 
    <td><?php echo $row->assign_to; ?></td> 
    <td><a id="txt"></a></td> 
 </tr> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T17:25:00+00:00Added an answer on May 13, 2026 at 5:25 pm

    Have your button populate a hidden formfield with a timestamp when it is clicked. Set the form to POST to a PHP script which processes the formfields and stores them where you like.

    ETA: So on your form you’ll need a field like this (with a unique name) for every timestamp you wish to store:

    <input type='hidden' name='mytimestamp_unique' id='mytimestamp_unique' value=''/>
    

    And then you’ll add some code to your javascript function to set the value of the corresponding “mytimestamp” field. Something like:

    function lockme(id){
     //parse the id to get the unique part of the id which is also the unique part of mytimestamp_unique
      var $hiddenfield=getElementById('mytimestamp_' + $uniquepart);
      $hiddenfield.value=new Date().getTime(); 
    
      //do other lockme stuff
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 398k
  • Answers 398k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can't convert directly from InnoDB to MyISAM while the… May 15, 2026 at 3:44 am
  • Editorial Team
    Editorial Team added an answer the problem is in your setter of the productQuantity it… May 15, 2026 at 3:44 am
  • Editorial Team
    Editorial Team added an answer Oh my, five hours of working on this, ive just… May 15, 2026 at 3:44 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.