-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd.html
96 lines (95 loc) · 2.75 KB
/
add.html
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Add Link - Movie Catalyst</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #000;
color: #fff;
margin: 0;
padding: 0;
}
header {
text-align: center;
padding: 20px 0;
background-color: #000;
}
main {
padding: 20px;
}
.add-form {
text-align: center;
}
input[type="text"] {
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
width: 300px;
margin-bottom: 10px;
}
button {
padding: 10px 20px;
border: none;
background-color: #007bff;
color: #fff;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
.button-container {
position: absolute;
top: 20px;
right: 20px;
}
</style>
</head>
<body>
<div class="button-container">
<button onclick="location.href='index.html'">Home</button>
<button onclick="location.href='termsofservice.html'">Terms of Service</button>
</div>
<header>
<h1>Movie Catalyst</h1>
</header>
<main>
<div class="add-form">
<h2>Add New Link</h2>
<form id="addForm">
<input type="text" id="linkInput" placeholder="Link URL">
<br>
<input type="text" id="nameInput" placeholder="Name">
<br>
<button type="submit">Add</button>
</form>
</div>
</main>
<script>
document.getElementById('addForm').addEventListener('submit', function(event) {
event.preventDefault();
const link = document.getElementById('linkInput').value;
const name = document.getElementById('nameInput').value;
fetch('https://1234gds.pythonanywhere.com/add', {
method: 'GET',
headers: {
'link': link,
'name': name
}
})
.then(response => {
if (response.ok) {
alert('Link added successfully');
document.getElementById('addForm').reset(); // Reset form fields
} else {
throw new Error('Failed to add link');
}
})
.catch(error => console.error('Error:', error));
});
</script>
</body>
</html>