-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathformToDB.php
More file actions
29 lines (26 loc) · 1.21 KB
/
Copy pathformToDB.php
File metadata and controls
29 lines (26 loc) · 1.21 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
<form method="post">
<input class="srt-box" type="text" name="name" id="" placeholder="Name *" />
<input class="srt-box" type="email" name="email" id="" placeholder="E-mail *" />
<input class="lrg-box" type="text" name="subject" placeholder="Subject" />
<textarea class="txt-area" name="message" id="" placeholder="Message *"></textarea>
<!-- <div class="agree-box">
<input type="checkbox" name="" id="" />
<p>I agree that my submitted data is being collected and stored.</p>
</div> -->
<div class="sbt">
<input type="submit" name="submit" value="Send Message" class="btn btn-primary sbt-btn">
</input>
</div>
<?php
if (isset($_POST['submit'])) {
$name = $_POST['name'];
$email = $_POST['email'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$sql = "INSERT INTO inquiry (name,email,subject,message) VALUES ('$name','$email','$subject','$message') ";
if (!mysqli_query($connection, $sql)) {
echo 'error:' . mysqli_error($connection);
}
}
?>
</form>