8dayssooner
04-18-2007, 06:29 PM
php:<?php
$x = "testing";
$hour="10";
$mins="30";
$secs="00";
echo "countdown=$x&h1=$hour&m1=$mins&s1=$secs";
?>
countdown = test box i have set up to check the variables i am loading
h1 = hours
m1 = mins
s1 = secs
actionscript:loadVariables("http://localhost/site/servercountdown/countdown4/test.php", this, "GET");
v1 = h1;
v2 = m1;
v3 = s1;
d = new Date();
hour = v1-d.getHours();
if (length(hour) < 2) {
hour = "0" - hour;
}
minute = v2-d.getMinutes();
if (length(minute) < 2) {
minute = "0" - minute;
}
sec = v3-d.getSeconds();
if (length(sec) < 2) {
sec = "0" - sec;
}
//s = d.getUTCDate();
Hi, i am using the above codes to create a countdown timer.
The timer is going to be used to countdown to an event that happens every so often at a time set by another script which a mate is coding, but im having trouble getting my test script to count down to time i am specifying in the php.
at the moment, the counter seems to be counting up instead of down. if i set the variables to 24, 60, 60 (respectively), then they count down fine, but they count down to midnight, and not the time i am specifying in the PHP.
If anyone could help me, i would be very much grateful!
thanks in advance, and hope to see some replies soon.
Mike
$x = "testing";
$hour="10";
$mins="30";
$secs="00";
echo "countdown=$x&h1=$hour&m1=$mins&s1=$secs";
?>
countdown = test box i have set up to check the variables i am loading
h1 = hours
m1 = mins
s1 = secs
actionscript:loadVariables("http://localhost/site/servercountdown/countdown4/test.php", this, "GET");
v1 = h1;
v2 = m1;
v3 = s1;
d = new Date();
hour = v1-d.getHours();
if (length(hour) < 2) {
hour = "0" - hour;
}
minute = v2-d.getMinutes();
if (length(minute) < 2) {
minute = "0" - minute;
}
sec = v3-d.getSeconds();
if (length(sec) < 2) {
sec = "0" - sec;
}
//s = d.getUTCDate();
Hi, i am using the above codes to create a countdown timer.
The timer is going to be used to countdown to an event that happens every so often at a time set by another script which a mate is coding, but im having trouble getting my test script to count down to time i am specifying in the php.
at the moment, the counter seems to be counting up instead of down. if i set the variables to 24, 60, 60 (respectively), then they count down fine, but they count down to midnight, and not the time i am specifying in the PHP.
If anyone could help me, i would be very much grateful!
thanks in advance, and hope to see some replies soon.
Mike