login test gpt chat ai helped (did everyhtging t)
This commit is contained in:
29
assets/login-script.js
Normal file
29
assets/login-script.js
Normal file
@@ -0,0 +1,29 @@
|
||||
function login() {
|
||||
var email = document.getElementById("email").value;
|
||||
var password = document.getElementById("password").value;
|
||||
|
||||
// Assuming you use fetch API to send data to the server
|
||||
fetch('https://home.adlerka.top/account', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
action: 'login',
|
||||
email: email,
|
||||
password: password
|
||||
}),
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.status === 'success') {
|
||||
document.getElementById("statusMessage").innerText = "Login successful!";
|
||||
// Redirect or perform other actions after successful login
|
||||
} else {
|
||||
document.getElementById("statusMessage").innerText = "Login failed. Please check your credentials.";
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user