Current location: Hot Scripts Forums » Programming Languages » PHP » Calculating time difference


Calculating time difference

Reply
  #1 (permalink)  
Old 07-17-04, 07:56 AM
rocky's Avatar
rocky rocky is offline
Newbie Coder
 
Join Date: Jul 2004
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Question Calculating time difference

Hi all,

Is there a way i can calculate the difference by which when i submit a form and getting the confirmation page.

To be more clear
I need the time difference , i want to know how much time it took to see my confirmation form after i pressed the submit button


Thanks
Rocky
Reply With Quote
  #2 (permalink)  
Old 07-17-04, 02:47 PM
kvnband kvnband is offline
Wannabe Coder
 
Join Date: Jun 2003
Posts: 242
Thanks: 0
Thanked 0 Times in 0 Posts
I'm not gonna write it out for you, but basically you include a hidden variable inside your form that has the current time.

IE, you have a php file that has your form in it. In the form, in a hidden variable, you include something like <? time(); ?> for the hidden input's value. Then in your processor script, you subtract the first time from the time at which the processor script was loaded, and that'll tell you how many seconds the person was on the form.

Lookup the time function on php.net to find out more
Kevin
Reply With Quote
  #3 (permalink)  
Old 07-17-04, 02:48 PM
kvnband kvnband is offline
Wannabe Coder
 
Join Date: Jun 2003
Posts: 242
Thanks: 0
Thanked 0 Times in 0 Posts
Oops..sorry, I thought you were wanting the time that it took a user to fill out the form.

I don't know how you'd do the whole submit thing though, except maybe...javascript might allow you to onclick of the button, store cookie on computer regarding what time it is, then your confirmation script loads the cookie, and checks against current time.

Just some thoughts
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Accurately showing different time zones meveskr JavaScript 5 07-20-04 03:57 PM
PHP Error Fairnie PHP 8 06-26-04 07:15 AM
Limit the form submission according to time bionicsamir PHP 7 05-09-04 11:10 PM
Reduce the time intensive phases of .Net application development using TierDeveloper3 smars General Advertisements 0 12-02-03 05:15 AM
Showing time is users time zone? Nasimov PHP 1 11-20-03 07:14 AM


All times are GMT -5. The time now is 05:12 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.