Jump to content

Recommended Posts

Good day!

 

I'm just a newbie in php and seeking for some assistance with my project as a beginner, as for now i do know how to insert data's in my database, but i'm having problem with this one;

 

Problem: 

  • My page requirements is that it must have a button to initiate start time ex. 0:00:00 <-- starting time.
  • Next one is, this page needs to change the amount the client need to pay for ex. For every 1 hr, they should be an amount of 60.00 and for another extended time for ex. 1:01 (1 hour and 1minute) the amount tendered must be 60+55 so total of 115.00. and if the timer hits 1:31 the amount should be in total of 120.00. and so on and so forth.
  • there's a button that will initiate stop time and will automatically save all the data to the database..

I'm researching this for a week now, and trying some functions and codes but nothing worked.. I guess I need to study more harder with php since it's my first time to study this one.

 

Any help will be appreciated.. thanks and god bless!

Are you okay with the page reloading each time the button is clicked? If so, you could look into using PHP's Event class for the timer:

http://php.net/manual/en/event.addtimer.php

 

 

However, if you want the button(s) to start / stop the timer without reloading the page, you'll need to use JavaScript.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.