This question already has an answer here:
I am a novice with html and PHP, but I have a fairly simple requirement. I have tried a number of different approaches, but none of them meet my needs.
The page should do the following:
Following is what I am currently trying in g_test_02.php. The problem is that when I load the page in a browser, when it refreshes from the header, it performs the even though I have not clicked the button. I can see this viewing the files on the server.
What am I doing wrong?
Thanks
<html>
<body>
<head>
<META HTTP-EQUIV="REFRESH"
CONTENT="30">
</head>
<?PHP
Do some php to display the date-timestamp of a file on the Unix server
?>
Display some html text and a picture
<script>
function myFunction() {
<?php
Do some php to modify files on the server
?>
location.reload();
}
</script>
<button onclick="myFunction()">Verify door</button>
</body>
</html>
</div>
Try this:
<html>
<body>
<script>
function myFunction() {
setInterval(function(){alert("Hello")}, 5000);
}
</script>
<button onclick="myFunction()">Verify door</button>
</body>
</html>