-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact_backup.php
201 lines (155 loc) · 6.09 KB
/
contact_backup.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
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<?php
session_start();
if (!isset($_SESSION["user_name"]) && !isset($_SESSION['usertype'])) {
header("location: index.php");
}
include "connection.php";
if(isset($_POST['btnSubmit'])){
$message=$_POST['txtMsg'];
$phone=$_POST['txtPhone'];
$username=$_SESSION['user_name']; //later has to be changed. user name will be obtained from session.//
function testfunc($data)
{
$data=trim($data);
$data=stripslashes($data);
$data=htmlspecialchars($data);
return $data;
}
$message=mysqli_real_escape_string($con,$message);
$phone=mysqli_real_escape_string($con,$phone);
$username=mysqli_real_escape_string($con,$username);
//$message=testfunc($message);
//$phone=testfunc($phone);
//$username=testfunc($username);
$query= "insert into contactus(username,phone,message) values('$username','$phone','$message')";
$result=mysqli_query($con,$query);
if(!$result){
die('failed query');
}
header("location: contact.php");
}
?>
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width = device-width, initial-scale = 1.0, user-scalable = yes">
<script src="./js/all.js"></script>
<link href="./css/contactstyle.css" rel="stylesheet">
<link rel="stylesheet" href="./css/bootstrap.min.css">
<title>Contact Us</title>
<style>
.header {
background: url("images/GIKI2.jpg");
background-size: cover;
background-position:fixed;
background-repeat: no-repeat;
}
body{
font-family:sans-serif;
}
</style>
</head>
<body>
<div class="container-fluid" style="margin-bottom: 0;">
<!-- header -->
<div class="row header pb-3 pt-0">
<div class="col">
<h1 class="display-3 font-weight-bold">GIK <span style="color:#062b5c;font-weight: lighter">Forum</span>
</h1>
</div>
</div>
<!-- end header -->
</div>
<nav class="navbar navbar-expand-lg navbar-light" style="background:#0f3f7e">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link text-white" <?php if($_SESSION['usertype']=='guest'){echo "href='guest.php'";}else{ echo "href='home.php'";} ?>><i class="fa fa-home mr-2"></i>Home <span
class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link text-white" href="contact.php">Contact Us</a>
</li>
<li class="nav-item">
<a class="nav-link text-white" href="aboutus.php">About Us</a>
</li>
<?php if($_SESSION['usertype']!="guest")
{
echo '<li class="nav-item dropdown" id="spec">
<a class="nav-link dropdown-toggle text-white" href="#" id="navbarDropdown" role="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Account
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item " href="account.php">Settings</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item text-danger" onclick="des()" href="index.php">Sign Out</a>
</div>
</li>' ;
}
?>
</ul>
</div>
</nav>
<script>
function des()
{
var a = 1;
$.ajax({
url: "post.php",
type: "POST",
data: {a},
success: function(result)
{
}
});
}
</script>
<div class="d-flex justify-content-center mb-5">
<div class=" contactdiv container align-items-center contact-form my-3 mx-5">
<div class="contact-image">
<img src="./css/images/contact.png" alt="rocket_contact"/>
</div>
<form method="post">
<h3 class="text-white">Drop Us a Message</h3>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<input type="text" name="txtName" class="form-control" placeholder="Your Name *" value="" required />
</div>
<div class="form-group">
<input type="email" name="txtEmail" class="form-control" placeholder="Your Email *" value="" required />
</div>
<div class="form-group">
<input type="text" name="txtPhone" class="form-control" placeholder="Your Phone Number *" value="" required />
</div>
<!-- -->
</div>
<div class="col-md-6">
<div class="form-group">
<textarea name="txtMsg" class="form-control" placeholder="Your Message *" required style="width: 100%; height: 150px;"></textarea>
</div>
<div class="form-group">
<input type="submit" name="btnSubmit" class="btn btnContact" value="Send Message" />
</div>
</div>
</div>
</form>
</div>
</div>
<div class="container-fluid">
<footer style="font-size:1.5vw;position:absolute;text-align:center;width:96%;padding-top:10vw;margin-bottom:5px">
© 2019 Copyright:
Netronix
</footer>
</div>
<script src="./js/jquery-3.3.1.min.js"></script>
<!-- bootstrap js-->
<script src="./js/bootstrap.bundle.min.js"></script>
<script src="./js/bootstrap.min.js"></script>
<script src="./js/jquery-3.3.1.min.js"></script>
</body>