-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest1.html
More file actions
50 lines (50 loc) · 1.46 KB
/
test1.html
File metadata and controls
50 lines (50 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PHP Date and Time</title>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
}
.message {
background-color: #f0f0f0;
padding: 20px;
border: 1px solid #ccc;
margin: 50px auto;
width: 80%;
max-width: 400px;
}
button {
padding: 10px 20px;
font-size: 16px;
background-color: #007bff;
color: #fff;
border: none;
cursor: pointer;
}
</style>
</head>
<body>
<div class="message">
<h2>Click the button to get the current date and time:</h2>
<button onclick="getDateTime()">Get Date and Time</button>
<p id="datetime"></p>
<img src="/logo.jpg" width="225" height="151">
<script>
function getDateTime() {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
document.getElementById("datetime").textContent = xhr.responseText;
}
};
xhr.open("GET", "get_currentTime.php", true);
xhr.send();
}
</script>
</div>
</body>
</html>