Forum Moderators: coopster
var serverTime = '<?php print date("F d, Y H:i:s", time())?>'
$hours = "document.getElementById('hours1')"?
var timeLeft1 = new Date('<?php print date("F d, Y H:i:s", time())?>')
var h = //pulling value from timer_hour on my db
var m = //pulling value from timer_minutes on my db
var s = //pulling value from timer_seconds on my db
timeLeft1.setHours(h,m,s);
var hours = timeLeft1.getHours();
var minutes = timeLeft1.getMinutes();
var seconds = timeLeft1.getSeconds();
//Send h,m,s values to <div>s on the page.
document.getElementById("hours1").innerHTML= hours;
document.getElementById("minutes1").innerHTML= minutes;
document.getElementById("seconds1").innerHTML= seconds;
<?php
preg_match('/<([^\s]+)[^>]+?id=("|\')hours1\\2[^>]*?>.*?<\/\\1>/', $input, $hours1);
preg_match('/<([^\s]+)[^>]+?id=("|\')minutes1\\2[^>]*?>.*?<\/\\1>/', $input, $minutes1);
preg_match('/<([^\s]+)[^>]+?id=("|\')seconds1\\2[^>]*?>.*?<\/\\1>/', $input, $seconds1);
mysql_connect(//connection info);
mysql_select_db(//db info);
$sql="UPDATE timer_values SET timer_hour='$hours1[0]', timer_minutes='$minutes1[0]', timer_seconds='$seconds1[0]' WHERE pod='1'";
?>
<div id="hours1" name="hours1"></div>
<div id="minutes1" name="minutes1"></div>
<div id="seconds1" name="seconds1"></div>
preg_match('/<([^\s]+)[^>]+?id=("|\')hours1\\2[^>]*?>(.*?)<\/\\1>/', $input, $hours1);
echo $hours1[3];