hackerzz;10909856 wrote:<!-- add your data here --> i leave blank is that ok?
It should be fine. I only offered that as an option in case you needed to send some data to the PHP script.
As to why it wasn't submiting data to your data base I would have to see your PHP and SQL.
if(hours==3){
document.write("haha")
}
That will not work because the "hours" variable is a local scope. It was set in the "showtime" function so in the above segment "hours" is undefined. To set "hours" in a global scope set "var hours;" outside of the functions.
var hours;
var timerID = null;
var timerRunning = false;
function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function showtime () {
var now = new Date();
hours = now.getHours(); // note the change here as well
var minutes = now.getMinutes();
var seconds = now.getSeconds()
var timeValue = "" + ((hours >12) ? hours -12 :hours)
if (timeValue == "0") timeValue = 12;
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
timeValue += (hours >= 12) ? " P.M." : " A.M."
document.clock.face.value = timeValue;
timerID = setTimeout("showtime()",1000);
timerRunning = true;
}
function startclock() {
stopclock();
showtime();
}
if(hours==3){
document.write("haha")
}
Also the "document.write" will just write to first character space on the screen which may be under something. Use "alert()" as it will make sure it doesn't get hidden
if(hours==3){
alert("haha")
}