Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 3.145.64.210
document
.getElementById("loginForm")
.addEventListener("submit", function (event) {
event.preventDefault();
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
if (username === "user" && password === "password") {
window.location.href = "dashboard.html";
} else {
alert("Invalid username or password");
}
});
function dragOverHandler(event) {
event.preventDefault();
}
function dropHandler(event) {
event.preventDefault();
const files = event.dataTransfer.files;
if (files.length > 0) {
const file = files[0];
const formData = new FormData();
formData.append("file", file);
fetch("/upload", {
method: "POST",
body: formData,
})
.then((response) => response.json())
.then((data) => {
console.log("Upload successful:", data);
alert("File uploaded successfully");
})
.catch((error) => {
console.error("Error uploading file:", error);
alert("Error uploading file");
});
}
}
|