-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathredirect.html
More file actions
52 lines (48 loc) · 1.86 KB
/
Copy pathredirect.html
File metadata and controls
52 lines (48 loc) · 1.86 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
51
52
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Welcome back</title>
<link rel="stylesheet" href="login.css" />
</head>
<body>
<div class="container">
<script>
// Retrieve user details from the query parameters
const urlParams = new URLSearchParams(window.location.search);
const name = urlParams.get("name");
const mobile = urlParams.get("mobile");
// information about the code being sent
document.write(
`<h1>Welcome, ${name}!</h1>
<p>A numeric code has been sent to ${mobile}. Enter it below, then you can satisfy your hunger<br>
🍔🍟🍕</p>`
);
document.write(`
<form id="codeForm">
<input type="text" name="code" id="codeInput" placeholder="" />
<button type="submit">Submit</button>
</form>
`);
// Add event listener to the form
document
.getElementById("codeForm")
.addEventListener("submit", function (event) {
event.preventDefault(); // Prevent the default form submission behavior
// Get the code input value
const codeValue = document.getElementById("codeInput").value;
// Check if the code is strictly equal to a numeric value
if (!isNaN(codeValue) && typeof +codeValue === "number") {
// replace '123' with your desired numeric code
// Redirect to the desired link
window.location.href = "https://www.ubereats.com/gb";
} else {
// Handle invalid code case
alert("Invalid code. Please try again with a numeric code.");
}
});
</script>
</div>
</body>
</html>