How do I send data in the database after a few minutes on onClick button?

Can anyone help me to send data into the database after some time interval after clicking of any button? Button has already value but I want to store data after some time interval.

store it immediately and set a timestamp from when on it should be used.

After the playing of any video on my web page then I want to add some points of users in database after 30sec the playing of video.
How can I do this? Can you help me?

I would think you’ll need to set a timer when you start playing the video, have that time out after 30 seconds, and in the callback function you send the data to the server.

The video playing and timer will be JavaScript because they’re running on the client. You can then use Ajax to call the PHP script on your code, passing whatever data you need from the browser.

You might be better off looking through the JavaScript section of the board, as that’s the main stuff you’ll need first - the PHP to store the information in the database will be minor. There’s a thread on there talking about how to stop a video after a certain time, that covers creating the timeout and the callback function from it, so you could get that bit working first and then come back for more advice if you need it. (ETA: This is the thread: Limiting the recording time - #49 by Paul_Wilkins )

Help, yes. Do it all from the start, no. Make a start on the code and come back as you need more help. How much experience of JavaScript and PHP do you have?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.