-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontectus.php
143 lines (102 loc) · 4.51 KB
/
contectus.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
<!doctype html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<title>Contact Us</title>
<style>
.text_area {
height:150px;
min-height:150px;
max-height:150px;
border-radius:0;
}
</style>
</head>
<body >
<!-- this header linked -->
<?php include 'parshial/header.php'; ?>
<!-- inset data into database -->
<!-- -->
<?php
$showAlert=false;
include 'parshial/dbconnection.php';
$method =$_SERVER['REQUEST_METHOD'];
if ($method =="POST") {
$firstname =$_POST['firstname'];
$lastname =$_POST['lastname'];
$email =$_POST['email'];
$phoneno =$_POST['phoneno'];
$textarea =$_POST['textarea'];
if ($firstname != $lastname) {
$sql ="INSERT INTO `contact's` ( `firstname`, `lastname`, `email`, `phone`, `texts`, `dt`) VALUES ( '$firstname', '$lastname', '$email', '$phoneno', '$textarea', current_timestamp())";
$result =mysqli_query($connection, $sql);
if ($result) {
$showAlert=true;
}
}
else{
echo "firstname and lastname not mach";
}
}
?>
<div class="card bg-dark text-white">
<img src="https://images.unsplash.com/photo-1622044680480-f67647ae1497?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8MTd8fGhlYWRlciUyMGltYWdlc3xlbnwwfHwwfHw%3D&auto=format&fit=crop&w=5000&q=600 " width="100" height="240" class="card-img" alt="...">
<div class="card-img-overlay" id="">
<h2 class="card-title">Contact Us</h2>
<!-- <p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
<p class="card-text">Last updated 3 mins ago</p>
</div> -->
</div>
<center>
<form class=" form-control" id="content us" action="/foram-project/contectus.php" method="post">
<h1> Send Us your question:</h1>
<div class="row">
<div class=" col-md-2 col-lg-12">
<div class="col-md-5 ">
<div class="form-group my-4">
<input type="firstname" name="firstname" class="form-control" placeholder="Your first name" required="">
</div>
</div>
<div class="col-md-5">
<div class="form-group my-4">
<input type="lastname" name="lastname" class="form-control" id="lastname" placeholder="Your last name" required="">
</div>
</div>
<div class=" col-md-5 ">
<div class="form-group ">
<input type="email" class="form-control" id="emailHelpl" name="email" aria-describedby="emailHelp" placeholder="Your email" required="">
<!-- <small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small> -->
</div>
</div>
<div class="form-group col-md-5">
<div class="form-group ">
<input type="mobilenumber" name="phoneno" class="form-control" id="InputPassword1" placeholder=" Your mobile* example:0311213421 " required="">
</div>
</div>
<div class="col-md-5 ">
<div class="form-group ">
<textarea class="form-control text_area" id="validationTextarea" rows="2" cols="2" name="textarea" placeholder="Required example textarea" required></textarea>
</div>
</div>
</div>
</div>
<!-- <div class="form-group form-check ">
<input type="checkbox" class="form-check-input" id="exampleCheck1">
<label class="form-check-label" for="exampleCheck1" name="check">Check me out</label>
</div> -->
<div class="form-group col-md-5 mb-5"><button type="submit" class="btn btn-primary btn-lg btn-block " >Submit</button>
</div>
</form>
</center>
<!-- this footer linked -->
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<?php include 'parshial/footer.php' ?>
</body>
</html>