-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfeedbackdb.php
118 lines (103 loc) · 2.2 KB
/
feedbackdb.php
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
<?php
if($_POST["s"]==1)
$username = $_POST["username"];
$email = $_POST["email"];
$phone = $_POST["phone"];
$orderid = $_POST["orderid"];
$deliveryspeed = $_POST["deliveryspeed"];
$deliveryexp = $_POST["deliveryexp"];
$packaging = $_POST["packaging"];
$quality = $_POST["quality"];
$comments = $_POST["comments"];
if( $deliveryspeed == "1")
{
$deliveryspeed = "P";
}
elseif( $deliveryspeed == "2")
{
$deliveryspeed = "BA";
}
elseif( $deliveryspeed == "3")
{
$deliveryspeed = "A";
}
elseif( $deliveryspeed == "4")
{
$deliveryspeed = "AA";
}
else{
$deliveryspeed = "E";
}
if( $deliveryexp == "1")
{
$deliveryexp = "P";
}
elseif( $deliveryexp == "2")
{
$deliveryexp = "BA";
}
elseif( $deliveryexp == "3")
{
$deliveryexp = "A";
}
elseif( $deliveryexp == "4")
{
$deliveryexp = "AA";
}
else{
$deliveryexp = "E";
}
if( $packaging == "1")
{
$packaging = "P";
}
elseif( $packaging == "2")
{
$packaging = "BA";
}
elseif( $packaging == "3")
{
$packaging = "A";
}
elseif( $packaging == "4")
{
$packaging = "AA";
}
else{
$packaging = "E";
}
if( $quality == "1")
{
$quality = "P";
}
elseif( $quality == "2")
{
$quality = "BA";
}
elseif( $quality == "3")
{
$quality = "A";
}
elseif( $quality == "4")
{
$quality = "AA";
}
else{
$quality = "E";
}
// connecting to database
$servername = "localhost";
$username = "root";
$password = "";
$database = "charliestore";
// create a connection
$con = mysqli_connect($servername, $username, $password, $database);
if(!$con)
{
echo "Unsuccessful";
}
$sql = "INSERT INTO feedback (username,email,phone,orderid,deliveryspeed,deliveryexp,packaging,quality,comments) VALUES ('$username','$email','$phone','$orderid','$deliveryspeed','$deliveryexp','$packaging','$quality','$comments')";
mysqli_query($con,$sql);
echo "data inserted successfully<BR>";
mysqli_close($con);
?>