473,394 Members | 1,663 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Browsed Time Problem.

i want to display the browsed time of a user, But when i refresh it, it will be again start from 0:0:0. How can it handle?

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  $total_mints=($live_match['match_name']) * (60);
  3.  
  4. ?>
  5. <script language="javascript">
  6. display_c(<?=$total_mints?>,'ct');
  7. </script>
  8.  
  9. <script type="text/javascript">
  10. function display_c(start,div){
  11.  
  12. window.start = parseFloat(start);
  13. var end = 0 // change this to stop the counter at a higher value
  14. var refresh=1000; // Refresh rate in milli seconds
  15. if(window.start >= end ){
  16.  
  17. mytime=setTimeout("display_ct('"+div+"')",refresh)
  18. }
  19. else {alert("Time Over ");}
  20. </script>
Jun 12 '10 #1
1 1116
Dormilich
8,658 Expert Mod 8TB
you would have to save the start time (when the user first accesses the site) in a PHP session and on every request in the session, you can print the difference to your HTML page.
Jun 12 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: jt | last post by:
Having a problem on trying to solve how to have the date and time displayed correctly and entered into my ms access database. I subscribe my web page being hosted remotely in Texas(CDT). I am...
6
by: Dhaval | last post by:
Hi, Well I am facing this strange issue with javascript. Specifically on the 26th October 2003, when I select any roomtype I get the rate 0 if "In the Operating system, Time Zone is selected...
3
by: Troy | last post by:
I have a class library (DLL) that I created and have been using for sometime in my various .NET applications. Recently, I have been having problems with what I believe is corruption (or a bug) of the...
0
by: twe | last post by:
We are stuck using this (very dated) combination on a certain piece of equipment. The problem is with daylight savings time. At 2am the system displays an error about the time changing and to...
6
by: Mark Reed | last post by:
Hi Guru's, I have created a database to monitor hours I have worked as our payroll department are so crap. I work nights most of the time but occasionally I have to work on days. Between the hours...
1
by: E. Liepins | last post by:
I am working on a vehicle database. We track when a vehicle is borrowed and when it is returned. We also track the number of kilometres travelled on a particular trip. There are several tables:...
3
by: idikoko | last post by:
I have a small problem I am trying to extract charcters from one string store it in another and then compare the new string and out a msg. The code looks fine but it always runs into a compiler...
0
by: anianu | last post by:
For example, we want to have date and time of data entry at the time we receive the complain. We get the date of complain when we select the date from calendar and also we get the display of...
5
by: KusoYumi | last post by:
Hello, im facing date and time problem. I want get a time in Date Type, with this format HH:mm:SS i try to get new Date(), then format it as String. Then i use substring to get the time. Then i...
5
by: id10t error | last post by:
I am makeing a program that will track productivity by every time a button is pushed i write a record to a text file. The text file contain the time in HHMMSS format. The next time they press a...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.