-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeedback.php
More file actions
183 lines (151 loc) · 5.69 KB
/
feedback.php
File metadata and controls
183 lines (151 loc) · 5.69 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<html lang = "en">
<head>
<title>Please fill this feedback form</title>
<link href = "bootstrap/css/bootstrap.min.css" rel = "stylesheet">
<link rel="stylesheet" type="text/css" href="styles/main.css">
<link rel="stylesheet" type="text/css" href="styles/magic.min.css">
<style>
body {
padding-top: 40px;
padding-bottom: 40px;
background-color: #000000;
}
.form-signin {
max-width: 400px;
padding: 15px;
margin: 0 auto;
color: #017572;
}
.form-signin .form-signin-heading,
.form-signin .checkbox {
margin-bottom: 7px;
}
.form-signin .checkbox {
font-weight: normal;
}
.form-signin .form-control {
position: relative;
height: auto;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 10px;
font-size: 16px;
}
.form-signin .form-control:focus {
z-index: 2;
}
.form-signin input[type="email"] {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
border-color:#017572;
}
.form-signin input[type="password"] {
margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
border-color:#017572;
}
h2{
text-align: center;
color: #FFFFFF;
}
h6{
text-align: center;
color: #FF0000;
}
h7{
text-align: center;
color: #FFFFFF;
}
label{
text-align: center;
color: #FFFFFF;
}
</style>
</head>
<body background="images/backgroung.png">
<h2>Please fill this feedback form</h2>
<div class = "container form-signin">
<?php
$msg = '';
if (isset($_POST['login']) && !empty($_POST['username'])
&& !empty($_POST['recovery'])) {
$user=$_POST['username'];
$star=$_POST['stars'];
$sugg=$_POST['suggestion'];
$conn=mysqli_connect("localhost","root","","db");
if($conn){
}
else{
echo "un";}
/*$result=mysqli_query($conn,"create database db");
if($result){
echo "<br>";
echo "successful";
}
else{
echo "un";}
$result=mysqli_query($conn,"create table datajiitmap(username varchar(30) unique,password varchar(20) not null,recovery varchar(30) not null)");
if($result){
echo "<br>";
echo "successful2";
}
else{
echo "un2";}
$result=mysqli_query($conn,"insert into datajiitmap values('bhavesh','1234','parents')");
if($result){
echo "<br>";
echo "successful2";
}
else{
echo "un2";}
*/
$sql = "select *from datajiitmap where username = '$user' and recovery = '$reco'";
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_array($result, MYSQLI_ASSOC);
$count = mysqli_num_rows($result);
if ($star<=5 && $star>=1 && count ==1) {
$sql = "update datajiitmap set suggestions='$sugg' where username = '$user'";
$result2 = mysqli_query($conn, $sql);
$sql = "update datajiitmap set stars='$star' where username = '$user'";
$result1 = mysqli_query($conn, $sql);
if($result1 && $result2){
echo '<script type ="text/JavaScript">';
echo 'alert("Registered succcessfully")';
echo '</script>';
echo '<script>
window.location="login page.php";
</script>';
}
}else {
$msg = '*Wrong username or incorrect stars';
}
}
else {
$msg = 'Please enter * required Fields';
$msg2="";}
?>
</div> <!-- /container -->
<div class = "container">
<form class = "form-signin" role = "form"
action = "<?php echo htmlspecialchars($_SERVER['PHP_SELF']);
?>" method = "post">
<h6 class = "form-signin-heading"><?php echo $msg; ?></h6>
<input type = "text" class = "form-control"
name = "username" placeholder = "username"
>*</br>
<input type = "number" class = "form-control"
name = "stars" placeholder = "Stars between 1 to 5">*<br></br>
<label for="w3review">Your valuable suggestion:</label>
<textarea id="w3review" name="suggestions" rows="4" cols="50" placeholder = "your valuable suggestions">
</textarea><br></br>
<button class = "btn btn-lg btn-primary btn-block" type = "submit"
name = "login">Save feedback</button>
</form>
<br>
<center><h7>Click here to go to <a href = "login page.php" tite = "Logout">home.</h7></center>
</div>
</body>
</html>