-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgallery_add.php
More file actions
147 lines (131 loc) · 4.78 KB
/
gallery_add.php
File metadata and controls
147 lines (131 loc) · 4.78 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
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<?php
include("connect.php");
$status = "";
if (isset($_POST['gallery_id']) && $_POST['gallery_id'] == 1) {
$photo_title = $_REQUEST['photo_title'];
$photo1 = $_REQUEST['photo1'];
$photo2 = $_REQUEST['photo2'];
$photo3 = $_REQUEST['photo3'];
$photo4 = $_REQUEST['photo4'];
$ins_query = "insert into gallery
(photo_title,photo1,photo2,photo3,photo4)values
('$photo_title','$photo1','$photo2','$photo3','$photo4')";
mysqli_query($con, $ins_query)
or die(mysqli_error($con));
$status = "Photo is uploaded successfully.";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>gallery</title>
<link rel="stylesheet" href="css/style.css" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<style>
body {
width: 100%;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background-image: url('image/adminbg2.png');
background-repeat: no-repeat;
background-size: cover;
}
.myform {
color: #ffffff;
display: flex;
justify-content: center;
margin: 10px 300px;
background-color: #0c0c0c;
opacity: .8;
z-index: 1;
/* padding: 20px; */
width: 88%;
border-radius: 15px;
border: 1px solid #f3f1f1;
box-shadow: 10px 10px 30px #3e3e3e66;
}
.myform h1 {
padding-bottom: 10px;
padding-top: 10px;
}
.myform label {
font-size: 23px;
font-weight: 600;
letter-spacing: 1px;
font-family: poppins;
padding-left: 20px;
}
.tabledata {
padding-top: 10px;
padding-bottom: 10px;
padding-right: 60px;
}
#inputbox {
width: 80%;
}
.other-link a {
margin: 5px 30px;
text-decoration: none;
text-transform: uppercase;
padding: 13px 25px;
background-color: #198754;
color: white;
border-radius: 8px;
font-size: 19px;
transition: background-color 0.3s;
}
.other-link a:hover {
background-color: #45a049;
}
</style>
</head>
<body>
<div class="myform">
<br>
<form name="form" method="post" action="">
<input type="hidden" name="gallery_id" value="1" />
<br>
<h1 style="font-family: Algerian;" align="center">Gallery</h1></br>
<table>
<tr>
<td class="tabledata"> <label for="photo_title">Title of photo:</label></td>
<td class="tabledata"> <input id="inputbox" type="text" name="photo_title" placeholder="enter photo title" required />
</td>
</tr>
<tr>
<td class="tabledata"><label for="photo1">Upload photo1 :</label></td>
<td class="tabledata"><input type="file" name="photo1" id="photo1" required />
</td>
</tr>
<tr>
<td class="tabledata"><label for="photo2">Upload photo2 :</label></td>
<td class="tabledata"> <input type="file" name="photo2" id="photo2" required />
</td>
</tr>
<tr>
<td class="tabledata"><label for="photo3">Upload photo3:</label></td>
<td class="tabledata"><input type="file" name="photo3" id="photo3" required />
</td>
</tr>
<tr>
<td class="tabledata"><label for="photo4">Upload photo4:</label></td>
<td class="tabledata"><input type="file" name="photo4" id="photo4" required />
</td>
</tr>
</table>
<br>
<p>
<br>
<input style=" margin:0px 30px; padding:10px 50px;" class="btn btn-lg btn-success" name="add" type="submit" value="SUBMIT" />
<span class="other-link"><a href="galleryadmin_view.php">view records</a></span>
</p>
<p style="color:#228B22;"><?php echo $status; ?></p>
<br>
</form>
</div>
</body>
</html>