JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 6th, 2013, 12:17 PM
phpstudent phpstudent is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 34 phpstudent User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 42 m 6 sec
Reputation Power: 1
Count 1 minute in php

Hi,

Everything is working fine except the start time. Once I click start, i want to see start time is ticking but start time does not change. I want future time static and start time dynamic.

Please advise.
PHP Code:
<html>

<?
PHP
$From 
date("H:i:s");
echo 
"From  $From ";
$Minutes 1;
echo 
"<br />";
$To date("H:i:s"strtotime($From)+($Minutes*60));
?>

<SCRIPT language="JavaScript">

function newtext()
{
document.getElementById("stBtn").disabled = true;
starttime = '<?php echo $From ;?>';
futuretime = '<?php echo $To ;?>';

document.getElementById("start").innerHTML = starttime;
document.getElementById("future").innerHTML = futuretime;
setTimeout("moretext()",1 * 60000);
 }

function moretext()
{

document.getElementById("subBtn").disabled = true;
}

</SCRIPT>

</HEAD>

<BODY>

<FORM name="myform" method="post" action="sessionS1.php">

<table width='600' cellpadding='5' cellspacing='5' border='1'> 
<tr> <td> <p id="start"></p> </td> <td> <p id="future"></p>  </td> <td> </td> </tr>

<tr><td colspan=6 align='right'><INPUT class = "button" id="stBtn" TYPE="button" name= mytext value="StartExam" onClick="newtext

()"></td></tr> 

<tr><td colspan=6 align='right'><input type='submit' id="subBtn"value='Score' name='btn_score'></td></tr> 

</table> 

</FORM>

</body>
</html> 

Reply With Quote
  #2  
Old January 6th, 2013, 03:34 PM
gw1500se gw1500se is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jul 2003
Posts: 2,885 gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Year 2 Weeks 3 Days 8 h 17 m 9 sec
Reputation Power: 581
This is a JavaScript question. For a Javascript example of a countdown timer see this.
__________________
There are 10 kinds of people in the world. Those that understand binary and those that don't.

Reply With Quote
  #3  
Old January 6th, 2013, 05:41 PM
VBAssassin VBAssassin is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Posts: 4 VBAssassin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 7 m 15 sec
Reputation Power: 0
As already mentioned, this is really a javascript question. However, you seem to be getting the starting time from PHP? Why? You may want to search google because many people have had the same reuest as yourself and will have created a solution.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Count 1 minute in php [moved from PHP]

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap